first
This commit is contained in:
67
safekiso-server/node_modules/snyk/dist/cli/110.index.js
generated
vendored
Normal file
67
safekiso-server/node_modules/snyk/dist/cli/110.index.js
generated
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
"use strict";
|
||||
exports.id = 110;
|
||||
exports.ids = [110];
|
||||
exports.modules = {
|
||||
|
||||
/***/ 73608:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
const snyk = __webpack_require__(9146);
|
||||
const validMethods = ['set', 'get', 'unset', 'clear'];
|
||||
async function config(method, ...args) {
|
||||
if (method && !validMethods.includes(method)) {
|
||||
throw new Error(`Unknown config command "${method}"`);
|
||||
}
|
||||
const key = args[0];
|
||||
if (method === 'set') {
|
||||
let res = '';
|
||||
args.forEach((item) => {
|
||||
const [key, val] = item.split(/=(.+)/);
|
||||
snyk.config.set(key, val);
|
||||
res += key + ' updated\n';
|
||||
// ensure we update the live library
|
||||
if (key === 'api') {
|
||||
snyk.api = val;
|
||||
}
|
||||
});
|
||||
return res;
|
||||
}
|
||||
if (method === 'get') {
|
||||
if (!key) {
|
||||
throw new Error('config:get requires an argument');
|
||||
}
|
||||
return snyk.config.get(key) || '';
|
||||
}
|
||||
if (method === 'unset') {
|
||||
if (!key) {
|
||||
throw new Error('config:unset requires an argument');
|
||||
}
|
||||
snyk.config.delete(key);
|
||||
if (key === 'api') {
|
||||
// ensure we update the live library
|
||||
snyk.api = null;
|
||||
}
|
||||
return `${key} deleted`;
|
||||
}
|
||||
if (method === 'clear') {
|
||||
snyk.config.clear();
|
||||
// ensure we update the live library
|
||||
snyk.api = null;
|
||||
return 'config cleared';
|
||||
}
|
||||
return Object.keys(snyk.config.all)
|
||||
.sort((a, b) => Number(a.toLowerCase() < b.toLowerCase()))
|
||||
.map((configKey) => `${configKey}: ${snyk.config.all[configKey]}`)
|
||||
.join('\n')
|
||||
.trim();
|
||||
}
|
||||
exports["default"] = config;
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
};
|
||||
;
|
||||
//# sourceMappingURL=110.index.js.map
|
||||
1
safekiso-server/node_modules/snyk/dist/cli/110.index.js.map
generated
vendored
Normal file
1
safekiso-server/node_modules/snyk/dist/cli/110.index.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"110.index.js","mappings":";;;;;;;;;;AAAA,uCAAkC;AAElC,MAAM,YAAY,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AAEvC,KAAK,UAAU,MAAM,CAClC,MAA0C,EAC1C,GAAG,IAAc;IAEjB,IAAI,MAAM,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;QAC5C,MAAM,IAAI,KAAK,CAAC,2BAA2B,MAAM,GAAG,CAAC,CAAC;KACvD;IAED,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;IAEpB,IAAI,MAAM,KAAK,KAAK,EAAE;QACpB,IAAI,GAAG,GAAG,EAAE,CAAC;QAEb,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YACpB,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YACvC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;YAC1B,GAAG,IAAI,GAAG,GAAG,YAAY,CAAC;YAE1B,oCAAoC;YACpC,IAAI,GAAG,KAAK,KAAK,EAAE;gBAChB,IAAY,CAAC,GAAG,GAAG,GAAG,CAAC;aACzB;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,GAAG,CAAC;KACZ;IAED,IAAI,MAAM,KAAK,KAAK,EAAE;QACpB,IAAI,CAAC,GAAG,EAAE;YACR,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;SACpD;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;KACnC;IAED,IAAI,MAAM,KAAK,OAAO,EAAE;QACtB,IAAI,CAAC,GAAG,EAAE;YACR,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;SACtD;QACD,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAExB,IAAI,GAAG,KAAK,KAAK,EAAE;YACjB,oCAAoC;YACnC,IAAY,CAAC,GAAG,GAAG,IAAI,CAAC;SAC1B;QAED,OAAO,GAAG,GAAG,UAAU,CAAC;KACzB;IAED,IAAI,MAAM,KAAK,OAAO,EAAE;QACtB,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QACpB,oCAAoC;QACnC,IAAY,CAAC,GAAG,GAAG,IAAI,CAAC;QACzB,OAAO,gBAAgB,CAAC;KACzB;IAED,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC;SAChC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;SACzD,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,GAAG,SAAS,KAAK,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;SACjE,IAAI,CAAC,IAAI,CAAC;SACV,IAAI,EAAE,CAAC;AACZ,CAAC;AA7DD,4BA6DC","sources":["webpack://snyk/./src/cli/commands/config.ts"],"sourcesContent":["import * as snyk from '../../lib';\n\nconst validMethods = ['set', 'get', 'unset', 'clear'];\n\nexport default async function config(\n method?: 'set' | 'get' | 'unset' | 'clear',\n ...args: string[]\n): Promise<string> {\n if (method && !validMethods.includes(method)) {\n throw new Error(`Unknown config command \"${method}\"`);\n }\n\n const key = args[0];\n\n if (method === 'set') {\n let res = '';\n\n args.forEach((item) => {\n const [key, val] = item.split(/=(.+)/);\n snyk.config.set(key, val);\n res += key + ' updated\\n';\n\n // ensure we update the live library\n if (key === 'api') {\n (snyk as any).api = val;\n }\n });\n\n return res;\n }\n\n if (method === 'get') {\n if (!key) {\n throw new Error('config:get requires an argument');\n }\n\n return snyk.config.get(key) || '';\n }\n\n if (method === 'unset') {\n if (!key) {\n throw new Error('config:unset requires an argument');\n }\n snyk.config.delete(key);\n\n if (key === 'api') {\n // ensure we update the live library\n (snyk as any).api = null;\n }\n\n return `${key} deleted`;\n }\n\n if (method === 'clear') {\n snyk.config.clear();\n // ensure we update the live library\n (snyk as any).api = null;\n return 'config cleared';\n }\n\n return Object.keys(snyk.config.all)\n .sort((a, b) => Number(a.toLowerCase() < b.toLowerCase()))\n .map((configKey) => `${configKey}: ${snyk.config.all[configKey]}`)\n .join('\\n')\n .trim();\n}\n"],"names":[],"sourceRoot":""}
|
||||
BIN
safekiso-server/node_modules/snyk/dist/cli/17fed5a77894e71b805c3fa99ec729cf.node
generated
vendored
Normal file
BIN
safekiso-server/node_modules/snyk/dist/cli/17fed5a77894e71b805c3fa99ec729cf.node
generated
vendored
Normal file
Binary file not shown.
4090
safekiso-server/node_modules/snyk/dist/cli/213.index.js
generated
vendored
Normal file
4090
safekiso-server/node_modules/snyk/dist/cli/213.index.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
safekiso-server/node_modules/snyk/dist/cli/213.index.js.map
generated
vendored
Normal file
1
safekiso-server/node_modules/snyk/dist/cli/213.index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
17527
safekiso-server/node_modules/snyk/dist/cli/231.index.js
generated
vendored
Normal file
17527
safekiso-server/node_modules/snyk/dist/cli/231.index.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
safekiso-server/node_modules/snyk/dist/cli/231.index.js.map
generated
vendored
Normal file
1
safekiso-server/node_modules/snyk/dist/cli/231.index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
47
safekiso-server/node_modules/snyk/dist/cli/284.index.js
generated
vendored
Normal file
47
safekiso-server/node_modules/snyk/dist/cli/284.index.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
safekiso-server/node_modules/snyk/dist/cli/284.index.js.map
generated
vendored
Normal file
1
safekiso-server/node_modules/snyk/dist/cli/284.index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
5407
safekiso-server/node_modules/snyk/dist/cli/31.index.js
generated
vendored
Normal file
5407
safekiso-server/node_modules/snyk/dist/cli/31.index.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
safekiso-server/node_modules/snyk/dist/cli/31.index.js.map
generated
vendored
Normal file
1
safekiso-server/node_modules/snyk/dist/cli/31.index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
4846
safekiso-server/node_modules/snyk/dist/cli/395.index.js
generated
vendored
Normal file
4846
safekiso-server/node_modules/snyk/dist/cli/395.index.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
safekiso-server/node_modules/snyk/dist/cli/395.index.js.map
generated
vendored
Normal file
1
safekiso-server/node_modules/snyk/dist/cli/395.index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
333041
safekiso-server/node_modules/snyk/dist/cli/464.index.js
generated
vendored
Normal file
333041
safekiso-server/node_modules/snyk/dist/cli/464.index.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
safekiso-server/node_modules/snyk/dist/cli/464.index.js.map
generated
vendored
Normal file
1
safekiso-server/node_modules/snyk/dist/cli/464.index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
103
safekiso-server/node_modules/snyk/dist/cli/477.index.js
generated
vendored
Normal file
103
safekiso-server/node_modules/snyk/dist/cli/477.index.js
generated
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
"use strict";
|
||||
exports.id = 477;
|
||||
exports.ids = [477];
|
||||
exports.modules = {
|
||||
|
||||
/***/ 15477:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
const policy = __webpack_require__(13284);
|
||||
const display_policy_1 = __webpack_require__(85655);
|
||||
const errors_1 = __webpack_require__(55191);
|
||||
async function displayPolicy(path) {
|
||||
try {
|
||||
const loadedPolicy = await policy.load(path || process.cwd());
|
||||
return await (0, display_policy_1.display)(loadedPolicy);
|
||||
}
|
||||
catch (error) {
|
||||
let adaptedError;
|
||||
if (error.code === 'ENOENT') {
|
||||
adaptedError = new errors_1.PolicyNotFoundError();
|
||||
}
|
||||
else {
|
||||
adaptedError = new errors_1.FailedToLoadPolicyError();
|
||||
adaptedError.innerError = error;
|
||||
}
|
||||
throw adaptedError;
|
||||
}
|
||||
}
|
||||
exports["default"] = displayPolicy;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 85655:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.display = void 0;
|
||||
const chalk_1 = __webpack_require__(32589);
|
||||
const snyk_policy_1 = __webpack_require__(13284);
|
||||
const config_1 = __webpack_require__(25425);
|
||||
async function display(policy) {
|
||||
const p = (0, snyk_policy_1.demunge)(policy, apiRoot);
|
||||
const delimiter = '\n\n------------------------\n';
|
||||
let res = chalk_1.default.bold('Current Snyk policy, read from ' + policy.__filename + ' file') + '\n';
|
||||
res += 'Modified: ' + policy.__modified + '\n';
|
||||
res += 'Created: ' + policy.__created + '\n';
|
||||
res += p.patch.map(displayRule('Patch vulnerability')).join('\n');
|
||||
if (p.patch.length && p.ignore.length) {
|
||||
res += delimiter;
|
||||
}
|
||||
res += p.ignore.map(displayRule('Ignore')).join('\n');
|
||||
if (p.ignore.length && p.exclude.length) {
|
||||
res += delimiter;
|
||||
}
|
||||
res += p.exclude.map(displayRule('Exclude')).join('\n');
|
||||
return Promise.resolve(res);
|
||||
}
|
||||
exports.display = display;
|
||||
// id url paths, path reason expires
|
||||
function displayRule(title) {
|
||||
return (rule, i) => {
|
||||
i += 1;
|
||||
const formattedTitle = title === 'Exclude'
|
||||
? chalk_1.default.bold(`\n#${i} ${title}`) +
|
||||
` the following ${chalk_1.default.bold(rule.id)} items/paths:\n`
|
||||
: chalk_1.default.bold(`\n#${i} ${title} ${rule.url}`) +
|
||||
' in the following paths:\n';
|
||||
return (formattedTitle +
|
||||
rule.paths
|
||||
.map((p) => {
|
||||
var _a;
|
||||
return (p.path +
|
||||
(p.reason
|
||||
? '\nReason: ' +
|
||||
p.reason +
|
||||
'\nExpires: ' +
|
||||
((_a = p.expires) === null || _a === void 0 ? void 0 : _a.toUTCString()) +
|
||||
'\n'
|
||||
: '') +
|
||||
'\n');
|
||||
})
|
||||
.join('')
|
||||
.replace(/\s*$/, ''));
|
||||
};
|
||||
}
|
||||
function apiRoot(vulnId) {
|
||||
const match = new RegExp(/^snyk:lic/i).test(vulnId);
|
||||
if (match) {
|
||||
return config_1.default.PUBLIC_LICENSE_URL;
|
||||
}
|
||||
return config_1.default.PUBLIC_VULN_DB_URL;
|
||||
}
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
};
|
||||
;
|
||||
//# sourceMappingURL=477.index.js.map
|
||||
1
safekiso-server/node_modules/snyk/dist/cli/477.index.js.map
generated
vendored
Normal file
1
safekiso-server/node_modules/snyk/dist/cli/477.index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
513
safekiso-server/node_modules/snyk/dist/cli/519.index.js
generated
vendored
Normal file
513
safekiso-server/node_modules/snyk/dist/cli/519.index.js
generated
vendored
Normal file
@@ -0,0 +1,513 @@
|
||||
"use strict";
|
||||
exports.id = 519;
|
||||
exports.ids = [519];
|
||||
exports.modules = {
|
||||
|
||||
/***/ 41519:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.addIacDriftAnalytics = exports.performanceAnalyticsObject = exports.addIacAnalytics = void 0;
|
||||
const types_1 = __webpack_require__(94820);
|
||||
const analytics = __webpack_require__(82744);
|
||||
const file_utils_1 = __webpack_require__(45281);
|
||||
const driftctl_1 = __webpack_require__(3659);
|
||||
function addIacAnalytics(formattedResults, opts) {
|
||||
let totalIssuesCount = 0;
|
||||
const customRulesIdsFoundInIssues = {};
|
||||
let issuesFromCustomRulesCount = 0;
|
||||
const projectTypeAnalytics = {};
|
||||
const packageManagers = Array();
|
||||
formattedResults.forEach((res) => {
|
||||
var _a;
|
||||
totalIssuesCount =
|
||||
(totalIssuesCount || 0) + res.result.cloudConfigResults.length;
|
||||
const projectType = res.packageManager;
|
||||
packageManagers.push(projectType);
|
||||
projectTypeAnalytics[projectType] = (_a = projectTypeAnalytics[projectType]) !== null && _a !== void 0 ? _a : {
|
||||
count: 0,
|
||||
};
|
||||
projectTypeAnalytics[projectType]['count']++;
|
||||
res.result.cloudConfigResults.forEach((policy) => {
|
||||
projectTypeAnalytics[projectType][policy.severity] =
|
||||
(projectTypeAnalytics[projectType][policy.severity] || 0) + 1;
|
||||
if (policy.isGeneratedByCustomRule) {
|
||||
issuesFromCustomRulesCount++;
|
||||
customRulesIdsFoundInIssues[policy.publicId] = true;
|
||||
}
|
||||
});
|
||||
});
|
||||
const uniqueCustomRulesCount = Object.keys(customRulesIdsFoundInIssues).length;
|
||||
analytics.add('packageManager', Array.from(new Set(packageManagers)));
|
||||
analytics.add('iac-issues-count', totalIssuesCount);
|
||||
analytics.add('iac-ignored-issues-count', opts.ignoredIssuesCount);
|
||||
analytics.add('iac-type', projectTypeAnalytics);
|
||||
analytics.add('iac-metrics', exports.performanceAnalyticsObject);
|
||||
analytics.add('iac-test-count', formattedResults.length); // TODO: remove this once we all analytics use iac-files-count
|
||||
analytics.add('iac-files-count', formattedResults.length);
|
||||
analytics.add('iac-local-custom-rules', opts.rulesOrigin === types_1.RulesOrigin.Local);
|
||||
analytics.add('iac-remote-custom-rules', opts.rulesOrigin === types_1.RulesOrigin.Remote);
|
||||
analytics.add('iac-custom-rules-issues-count', issuesFromCustomRulesCount);
|
||||
analytics.add('iac-custom-rules-checksum', (0, file_utils_1.computeCustomRulesBundleChecksum)());
|
||||
analytics.add('iac-custom-rules-coverage-count', uniqueCustomRulesCount);
|
||||
}
|
||||
exports.addIacAnalytics = addIacAnalytics;
|
||||
exports.performanceAnalyticsObject = {
|
||||
[types_1.PerformanceAnalyticsKey.InitLocalCache]: null,
|
||||
[types_1.PerformanceAnalyticsKey.FileLoading]: null,
|
||||
[types_1.PerformanceAnalyticsKey.FileParsing]: null,
|
||||
[types_1.PerformanceAnalyticsKey.FileScanning]: null,
|
||||
[types_1.PerformanceAnalyticsKey.OrgSettings]: null,
|
||||
[types_1.PerformanceAnalyticsKey.CustomSeverities]: null,
|
||||
[types_1.PerformanceAnalyticsKey.ResultFormatting]: null,
|
||||
[types_1.PerformanceAnalyticsKey.UsageTracking]: null,
|
||||
[types_1.PerformanceAnalyticsKey.CacheCleanup]: null,
|
||||
[types_1.PerformanceAnalyticsKey.Total]: null,
|
||||
};
|
||||
function addIacDriftAnalytics(analysis, options) {
|
||||
analytics.add('iac-drift-coverage', analysis.coverage);
|
||||
analytics.add('iac-drift-total-resources', analysis.summary.total_resources);
|
||||
analytics.add('iac-drift-total-unmanaged', analysis.summary.total_unmanaged);
|
||||
analytics.add('iac-drift-total-managed', analysis.summary.total_managed);
|
||||
analytics.add('iac-drift-total-missing', analysis.summary.total_missing);
|
||||
analytics.add('iac-drift-iac-source-count', analysis.summary.total_iac_source_count);
|
||||
analytics.add('iac-drift-provider-name', analysis.provider_name);
|
||||
analytics.add('iac-drift-provider-version', analysis.provider_version);
|
||||
analytics.add('iac-drift-version', driftctl_1.driftctlVersion);
|
||||
analytics.add('iac-drift-scan-duration', analysis.scan_duration);
|
||||
let scope = 'all';
|
||||
if (options['only-managed']) {
|
||||
scope = 'managed';
|
||||
}
|
||||
else if (options['only-unmanaged']) {
|
||||
scope = 'unmanaged';
|
||||
}
|
||||
analytics.add('iac-drift-scan-scope', scope);
|
||||
}
|
||||
exports.addIacDriftAnalytics = addIacDriftAnalytics;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 45281:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.makeFileAndDirectoryGenerator = exports.computeCustomRulesBundleChecksum = exports.isValidBundle = exports.extractBundle = exports.createIacDir = void 0;
|
||||
const fs = __webpack_require__(57147);
|
||||
const tar = __webpack_require__(97998);
|
||||
const path = __webpack_require__(71017);
|
||||
const crypto = __webpack_require__(6113);
|
||||
const local_cache_1 = __webpack_require__(50089);
|
||||
const oci_pull_1 = __webpack_require__(166);
|
||||
const fs_1 = __webpack_require__(57147);
|
||||
const path_1 = __webpack_require__(71017);
|
||||
function hashData(s) {
|
||||
const hashedData = crypto.createHash('sha1').update(s).digest('hex');
|
||||
return hashedData;
|
||||
}
|
||||
function createIacDir() {
|
||||
// this path will be able to be customised by the user in the future
|
||||
const iacPath = path.join(local_cache_1.LOCAL_POLICY_ENGINE_DIR);
|
||||
try {
|
||||
if (!fs.existsSync(iacPath)) {
|
||||
fs.mkdirSync(iacPath, { recursive: true, mode: 0o700 });
|
||||
}
|
||||
fs.accessSync(iacPath, fs.constants.W_OK);
|
||||
}
|
||||
catch {
|
||||
throw new local_cache_1.FailedToInitLocalCacheError();
|
||||
}
|
||||
}
|
||||
exports.createIacDir = createIacDir;
|
||||
function extractBundle(response) {
|
||||
return new Promise((resolve, reject) => {
|
||||
response
|
||||
.on('error', reject)
|
||||
.pipe(tar.x({
|
||||
C: path.join(local_cache_1.LOCAL_POLICY_ENGINE_DIR),
|
||||
}))
|
||||
.on('finish', resolve)
|
||||
.on('error', reject);
|
||||
});
|
||||
}
|
||||
exports.extractBundle = extractBundle;
|
||||
function isValidBundle(wasmPath, dataPath) {
|
||||
try {
|
||||
// verify that the correct files were generated, since this is user input
|
||||
return !(!fs.existsSync(wasmPath) || !fs.existsSync(dataPath));
|
||||
}
|
||||
catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
exports.isValidBundle = isValidBundle;
|
||||
function computeCustomRulesBundleChecksum() {
|
||||
try {
|
||||
const customRulesPolicyWasmPath = path.join(local_cache_1.LOCAL_POLICY_ENGINE_DIR, oci_pull_1.CUSTOM_RULES_TARBALL);
|
||||
// if bundle is not configured we don't want to include the checksum
|
||||
if (!fs.existsSync(customRulesPolicyWasmPath)) {
|
||||
return;
|
||||
}
|
||||
const policyWasm = fs.readFileSync(customRulesPolicyWasmPath, 'utf8');
|
||||
return hashData(policyWasm);
|
||||
}
|
||||
catch (err) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
exports.computeCustomRulesBundleChecksum = computeCustomRulesBundleChecksum;
|
||||
/**
|
||||
* makeFileAndDirectoryGenerator is a generator function that helps walking the directory and file structure of this pathToScan
|
||||
* @param root
|
||||
* @param maxDepth? - An optional `maxDepth` argument can be provided to limit how deep in the file tree the search will go.
|
||||
* @returns {Generator<object>} - a generator which yields an object with directories or paths for the path to scan
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
||||
function* makeFileAndDirectoryGenerator(root = '.', maxDepth) {
|
||||
function* generatorHelper(pathToScan, currentDepth) {
|
||||
{
|
||||
yield { directory: pathToScan };
|
||||
}
|
||||
if (maxDepth !== currentDepth) {
|
||||
for (const dirent of (0, fs_1.readdirSync)(pathToScan, { withFileTypes: true })) {
|
||||
if (dirent.isDirectory() &&
|
||||
fs.readdirSync((0, path_1.join)(pathToScan, dirent.name)).length !== 0) {
|
||||
yield* generatorHelper((0, path_1.join)(pathToScan, dirent.name), currentDepth + 1);
|
||||
}
|
||||
else if (dirent.isFile()) {
|
||||
yield {
|
||||
file: {
|
||||
dir: pathToScan,
|
||||
fileName: (0, path_1.join)(pathToScan, dirent.name),
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
yield* generatorHelper(root, 0);
|
||||
}
|
||||
exports.makeFileAndDirectoryGenerator = makeFileAndDirectoryGenerator;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 50089:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
|
||||
|
||||
var _a;
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.InvalidCustomRulesPath = exports.InvalidCustomRules = exports.FailedToExtractCustomRulesError = exports.FailedToDownloadRulesError = exports.FailedToInitLocalCacheError = exports.cleanLocalCache = exports.initLocalCache = exports.getLocalCachePath = exports.assertNever = exports.CUSTOM_POLICY_ENGINE_WASM_PATH = exports.LOCAL_POLICY_ENGINE_DIR = void 0;
|
||||
const path = __webpack_require__(71017);
|
||||
const fs = __webpack_require__(57147);
|
||||
const types_1 = __webpack_require__(94820);
|
||||
const rimraf = __webpack_require__(50984);
|
||||
const file_utils_1 = __webpack_require__(45281);
|
||||
const Debug = __webpack_require__(15158);
|
||||
const errors_1 = __webpack_require__(55191);
|
||||
const analytics = __webpack_require__(82744);
|
||||
const error_utils_1 = __webpack_require__(36401);
|
||||
const config_1 = __webpack_require__(25425);
|
||||
const request_1 = __webpack_require__(1552);
|
||||
const env_paths_1 = __webpack_require__(21766);
|
||||
const error_catalog_nodejs_public_1 = __webpack_require__(88404);
|
||||
const debug = Debug('iac-local-cache');
|
||||
const cachePath = (_a = config_1.default.CACHE_PATH) !== null && _a !== void 0 ? _a : (0, env_paths_1.default)('snyk').cache;
|
||||
const uuid = Math.random().toString(36).substring(2);
|
||||
exports.LOCAL_POLICY_ENGINE_DIR = cachePath + '/iac-data/' + uuid;
|
||||
const KUBERNETES_POLICY_ENGINE_WASM_PATH = path.join(exports.LOCAL_POLICY_ENGINE_DIR, 'k8s_policy.wasm');
|
||||
const KUBERNETES_POLICY_ENGINE_DATA_PATH = path.join(exports.LOCAL_POLICY_ENGINE_DIR, 'k8s_data.json');
|
||||
const TERRAFORM_POLICY_ENGINE_WASM_PATH = path.join(exports.LOCAL_POLICY_ENGINE_DIR, 'tf_policy.wasm');
|
||||
const TERRAFORM_POLICY_ENGINE_DATA_PATH = path.join(exports.LOCAL_POLICY_ENGINE_DIR, 'tf_data.json');
|
||||
const CLOUDFORMATION_POLICY_ENGINE_WASM_PATH = path.join(exports.LOCAL_POLICY_ENGINE_DIR, 'cloudformation_policy.wasm');
|
||||
const CLOUDFORMATION_POLICY_ENGINE_DATA_PATH = path.join(exports.LOCAL_POLICY_ENGINE_DIR, 'cloudformation_data.json');
|
||||
const ARM_POLICY_ENGINE_WASM_PATH = path.join(exports.LOCAL_POLICY_ENGINE_DIR, 'arm_policy.wasm');
|
||||
const ARM_POLICY_ENGINE_DATA_PATH = path.join(exports.LOCAL_POLICY_ENGINE_DIR, 'arm_data.json');
|
||||
// NOTE: The filenames used for the custom policy bundles match those output
|
||||
// by the `opa` CLI tool, which is why they are very generic.
|
||||
exports.CUSTOM_POLICY_ENGINE_WASM_PATH = path.join(exports.LOCAL_POLICY_ENGINE_DIR, 'policy.wasm');
|
||||
const CUSTOM_POLICY_ENGINE_DATA_PATH = path.join(exports.LOCAL_POLICY_ENGINE_DIR, 'data.json');
|
||||
function assertNever(value) {
|
||||
throw new Error(`Unhandled discriminated union member: ${JSON.stringify(value)}`);
|
||||
}
|
||||
exports.assertNever = assertNever;
|
||||
function getLocalCachePath(engineType) {
|
||||
switch (engineType) {
|
||||
case types_1.EngineType.Kubernetes:
|
||||
return [
|
||||
`${KUBERNETES_POLICY_ENGINE_WASM_PATH}`,
|
||||
`${KUBERNETES_POLICY_ENGINE_DATA_PATH}`,
|
||||
];
|
||||
case types_1.EngineType.Terraform:
|
||||
return [
|
||||
`${TERRAFORM_POLICY_ENGINE_WASM_PATH}`,
|
||||
`${TERRAFORM_POLICY_ENGINE_DATA_PATH}`,
|
||||
];
|
||||
case types_1.EngineType.CloudFormation:
|
||||
return [
|
||||
`${CLOUDFORMATION_POLICY_ENGINE_WASM_PATH}`,
|
||||
`${CLOUDFORMATION_POLICY_ENGINE_DATA_PATH}`,
|
||||
];
|
||||
case types_1.EngineType.ARM:
|
||||
return [
|
||||
`${ARM_POLICY_ENGINE_WASM_PATH}`,
|
||||
`${ARM_POLICY_ENGINE_DATA_PATH}`,
|
||||
];
|
||||
case types_1.EngineType.Custom:
|
||||
return [
|
||||
`${exports.CUSTOM_POLICY_ENGINE_WASM_PATH}`,
|
||||
`${CUSTOM_POLICY_ENGINE_DATA_PATH}`,
|
||||
];
|
||||
default:
|
||||
assertNever(engineType);
|
||||
}
|
||||
}
|
||||
exports.getLocalCachePath = getLocalCachePath;
|
||||
async function initLocalCache({ customRulesPath, } = {}) {
|
||||
try {
|
||||
(0, file_utils_1.createIacDir)();
|
||||
}
|
||||
catch (e) {
|
||||
throw new FailedToInitLocalCacheError();
|
||||
}
|
||||
// Attempt to extract the custom rules from the path provided.
|
||||
if (customRulesPath) {
|
||||
if (!fs.existsSync(customRulesPath)) {
|
||||
throw new InvalidCustomRulesPath(customRulesPath);
|
||||
}
|
||||
try {
|
||||
const response = fs.createReadStream(customRulesPath);
|
||||
await (0, file_utils_1.extractBundle)(response);
|
||||
}
|
||||
catch (e) {
|
||||
throw new FailedToExtractCustomRulesError(customRulesPath);
|
||||
}
|
||||
if (!(0, file_utils_1.isValidBundle)(exports.CUSTOM_POLICY_ENGINE_WASM_PATH, CUSTOM_POLICY_ENGINE_DATA_PATH)) {
|
||||
throw new InvalidCustomRules(customRulesPath);
|
||||
}
|
||||
}
|
||||
// IAC_BUNDLE_PATH is a developer setting that is not useful to most users. It
|
||||
// is not a replacement for custom rules.
|
||||
if (config_1.default.IAC_BUNDLE_PATH) {
|
||||
const stream = fs.createReadStream(config_1.default.IAC_BUNDLE_PATH);
|
||||
await (0, file_utils_1.extractBundle)(stream);
|
||||
return;
|
||||
}
|
||||
// We extract the Snyk rules after the custom rules to ensure our files
|
||||
// always overwrite whatever might be there.
|
||||
try {
|
||||
const BUNDLE_URL = 'https://downloads.snyk.io/cli/wasm/bundle.tar.gz';
|
||||
const response = await (0, request_1.streamRequest)({
|
||||
method: 'get',
|
||||
url: BUNDLE_URL,
|
||||
body: null,
|
||||
headers: {},
|
||||
});
|
||||
await (0, file_utils_1.extractBundle)(response);
|
||||
}
|
||||
catch (e) {
|
||||
throw new FailedToDownloadRulesError();
|
||||
}
|
||||
}
|
||||
exports.initLocalCache = initLocalCache;
|
||||
function cleanLocalCache() {
|
||||
// path to delete is hardcoded for now
|
||||
const iacPath = path.normalize(exports.LOCAL_POLICY_ENGINE_DIR);
|
||||
try {
|
||||
// when we support Node version >= 12.10.0 , we can replace rimraf
|
||||
// with the native fs.rmdirSync(path, {recursive: true})
|
||||
rimraf.sync(iacPath);
|
||||
}
|
||||
catch (e) {
|
||||
const err = new FailedToCleanLocalCacheError();
|
||||
analytics.add('error-code', err.code);
|
||||
debug('The local cache directory could not be deleted');
|
||||
}
|
||||
}
|
||||
exports.cleanLocalCache = cleanLocalCache;
|
||||
class FailedToInitLocalCacheError extends errors_1.CustomError {
|
||||
constructor(message) {
|
||||
super(message || 'Failed to initialize local cache');
|
||||
this.code = types_1.IaCErrorCodes.FailedToInitLocalCacheError;
|
||||
this.strCode = (0, error_utils_1.getErrorStringCode)(this.code);
|
||||
this.userMessage =
|
||||
'We were unable to create a local directory to store the test assets, please ensure that the current working directory is writable';
|
||||
this.errorCatalog = new error_catalog_nodejs_public_1.CLI.GeneralIACFailureError('');
|
||||
}
|
||||
}
|
||||
exports.FailedToInitLocalCacheError = FailedToInitLocalCacheError;
|
||||
class FailedToDownloadRulesError extends errors_1.CustomError {
|
||||
constructor(message) {
|
||||
super(message || 'Failed to download policies');
|
||||
this.code = types_1.IaCErrorCodes.FailedToDownloadRulesError;
|
||||
this.strCode = (0, error_utils_1.getErrorStringCode)(this.code);
|
||||
this.userMessage =
|
||||
'We were unable to download the security rules, please ensure the network can access https://downloads.snyk.io';
|
||||
this.errorCatalog = new error_catalog_nodejs_public_1.CLI.GeneralIACFailureError('');
|
||||
}
|
||||
}
|
||||
exports.FailedToDownloadRulesError = FailedToDownloadRulesError;
|
||||
class FailedToExtractCustomRulesError extends errors_1.CustomError {
|
||||
constructor(path, message) {
|
||||
super(message || 'Failed to download policies');
|
||||
this.code = types_1.IaCErrorCodes.FailedToExtractCustomRulesError;
|
||||
this.strCode = (0, error_utils_1.getErrorStringCode)(this.code);
|
||||
this.userMessage = `We were unable to extract the rules provided at: ${path}. The provided bundle may be corrupted or invalid. Please ensure it was generated using the 'snyk-iac-rules' SDK`;
|
||||
this.errorCatalog = new error_catalog_nodejs_public_1.CLI.GeneralIACFailureError('');
|
||||
}
|
||||
}
|
||||
exports.FailedToExtractCustomRulesError = FailedToExtractCustomRulesError;
|
||||
class InvalidCustomRules extends errors_1.CustomError {
|
||||
constructor(path, message) {
|
||||
super(message || 'Invalid custom rules bundle');
|
||||
this.code = types_1.IaCErrorCodes.InvalidCustomRules;
|
||||
this.strCode = (0, error_utils_1.getErrorStringCode)(this.code);
|
||||
this.userMessage = `We were unable to extract the rules provided at: ${path}. The provided bundle does not match the required structure. Please ensure it was generated using the 'snyk-iac-rules' SDK`;
|
||||
this.errorCatalog = new error_catalog_nodejs_public_1.CLI.GeneralIACFailureError('');
|
||||
}
|
||||
}
|
||||
exports.InvalidCustomRules = InvalidCustomRules;
|
||||
class InvalidCustomRulesPath extends errors_1.CustomError {
|
||||
constructor(path, message) {
|
||||
super(message || 'Invalid path to custom rules bundle');
|
||||
this.code = types_1.IaCErrorCodes.InvalidCustomRulesPath;
|
||||
this.strCode = (0, error_utils_1.getErrorStringCode)(this.code);
|
||||
this.userMessage = `We were unable to extract the rules provided at: ${path}. The bundle at the provided path does not exist`;
|
||||
this.errorCatalog = new error_catalog_nodejs_public_1.CLI.GeneralIACFailureError('');
|
||||
}
|
||||
}
|
||||
exports.InvalidCustomRulesPath = InvalidCustomRulesPath;
|
||||
class FailedToCleanLocalCacheError extends errors_1.CustomError {
|
||||
constructor(message) {
|
||||
super(message || 'Failed to clean local cache');
|
||||
this.code = types_1.IaCErrorCodes.FailedToCleanLocalCacheError;
|
||||
this.strCode = (0, error_utils_1.getErrorStringCode)(this.code);
|
||||
this.userMessage = ''; // Not a user facing error.
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 166:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.UnsupportedEntitlementPullError = exports.InvalidRemoteRegistryURLError = exports.InvalidManifestSchemaVersionError = exports.FailedToBuildOCIArtifactError = exports.pull = exports.extractOCIRegistryURLComponents = exports.CUSTOM_RULES_TARBALL = void 0;
|
||||
const fs_1 = __webpack_require__(57147);
|
||||
const path = __webpack_require__(71017);
|
||||
const types_1 = __webpack_require__(94820);
|
||||
const errors_1 = __webpack_require__(55191);
|
||||
const error_utils_1 = __webpack_require__(36401);
|
||||
const local_cache_1 = __webpack_require__(50089);
|
||||
const Debug = __webpack_require__(15158);
|
||||
const file_utils_1 = __webpack_require__(45281);
|
||||
const error_catalog_nodejs_public_1 = __webpack_require__(88404);
|
||||
const debug = Debug('iac-oci-pull');
|
||||
exports.CUSTOM_RULES_TARBALL = 'custom-bundle.tar.gz';
|
||||
function extractOCIRegistryURLComponents(OCIRegistryURL) {
|
||||
try {
|
||||
const urlWithoutProtocol = OCIRegistryURL.includes('://')
|
||||
? OCIRegistryURL.split('://')[1]
|
||||
: OCIRegistryURL;
|
||||
const firstSlashIdx = urlWithoutProtocol.indexOf('/');
|
||||
const [registryHost, repoWithTag] = [
|
||||
urlWithoutProtocol.substring(0, firstSlashIdx),
|
||||
urlWithoutProtocol.substring(firstSlashIdx + 1),
|
||||
];
|
||||
const [repo, tag = 'latest'] = repoWithTag.split(':');
|
||||
if (firstSlashIdx === -1 || !registryHost || !repoWithTag || !repo) {
|
||||
throw new InvalidRemoteRegistryURLError(OCIRegistryURL);
|
||||
}
|
||||
return { registryBase: registryHost, repo, tag };
|
||||
}
|
||||
catch {
|
||||
throw new InvalidRemoteRegistryURLError(OCIRegistryURL);
|
||||
}
|
||||
}
|
||||
exports.extractOCIRegistryURLComponents = extractOCIRegistryURLComponents;
|
||||
/**
|
||||
* Downloads an OCI Artifact from a remote OCI Registry and writes it to the
|
||||
* disk. The artifact here is a custom rules bundle stored in a remote registry.
|
||||
* In order to do that, it calls an external docker registry v2 client to get
|
||||
* the manifests, the layers and then builds the artifact. Example:
|
||||
* https://github.com/opencontainers/image-spec/blob/main/manifest.md#example-image-manifest
|
||||
*
|
||||
* @param registry The client for accessing an OCI registry.
|
||||
* @param repository The name of an OCI repository.
|
||||
* @param tag The tag of an image in an OCI repository.
|
||||
**/
|
||||
async function pull(registry, repository, tag) {
|
||||
const { schemaVersion, layers } = await registry.getManifest(repository, tag);
|
||||
if (schemaVersion !== 2) {
|
||||
throw new InvalidManifestSchemaVersionError(schemaVersion.toString());
|
||||
}
|
||||
// We assume that we will always have an artifact of a single layer
|
||||
if (layers.length > 1) {
|
||||
debug('There were more than one layers found in the OCI Artifact.');
|
||||
}
|
||||
const { blob } = await registry.getLayer(repository, layers[0].digest);
|
||||
try {
|
||||
const downloadPath = path.join(local_cache_1.LOCAL_POLICY_ENGINE_DIR, exports.CUSTOM_RULES_TARBALL);
|
||||
(0, file_utils_1.createIacDir)();
|
||||
await fs_1.promises.writeFile(downloadPath, blob);
|
||||
return downloadPath;
|
||||
}
|
||||
catch (err) {
|
||||
throw new FailedToBuildOCIArtifactError();
|
||||
}
|
||||
}
|
||||
exports.pull = pull;
|
||||
class FailedToBuildOCIArtifactError extends errors_1.CustomError {
|
||||
constructor(message) {
|
||||
super(message || 'Could not build OCI Artifact');
|
||||
this.code = types_1.IaCErrorCodes.FailedToBuildOCIArtifactError;
|
||||
this.strCode = (0, error_utils_1.getErrorStringCode)(this.code);
|
||||
this.userMessage =
|
||||
'We were unable to build the remote OCI Artifact locally, please ensure that the local directory is writeable.';
|
||||
this.errorCatalog = new error_catalog_nodejs_public_1.CLI.GeneralIACFailureError('');
|
||||
}
|
||||
}
|
||||
exports.FailedToBuildOCIArtifactError = FailedToBuildOCIArtifactError;
|
||||
class InvalidManifestSchemaVersionError extends errors_1.CustomError {
|
||||
constructor(message) {
|
||||
super(message || 'Invalid manifest schema version');
|
||||
this.code = types_1.IaCErrorCodes.InvalidRemoteRegistryURLError;
|
||||
this.strCode = (0, error_utils_1.getErrorStringCode)(this.code);
|
||||
this.userMessage = `Invalid manifest schema version: ${message}. We currently support Image Manifest Version 2, Schema 2`;
|
||||
this.errorCatalog = new error_catalog_nodejs_public_1.CLI.GeneralIACFailureError('');
|
||||
}
|
||||
}
|
||||
exports.InvalidManifestSchemaVersionError = InvalidManifestSchemaVersionError;
|
||||
class InvalidRemoteRegistryURLError extends errors_1.CustomError {
|
||||
constructor(url) {
|
||||
super('Invalid URL for Remote Registry');
|
||||
this.code = types_1.IaCErrorCodes.InvalidRemoteRegistryURLError;
|
||||
this.strCode = (0, error_utils_1.getErrorStringCode)(this.code);
|
||||
this.userMessage = `The provided remote registry URL${url ? `: "${url}"` : ''} is invalid. Please check it again.`;
|
||||
this.errorCatalog = new error_catalog_nodejs_public_1.CLI.GeneralIACFailureError('');
|
||||
}
|
||||
}
|
||||
exports.InvalidRemoteRegistryURLError = InvalidRemoteRegistryURLError;
|
||||
class UnsupportedEntitlementPullError extends errors_1.CustomError {
|
||||
constructor(entitlement) {
|
||||
super(`OCI Pull not supported - Missing the ${entitlement} entitlement`);
|
||||
this.code = types_1.IaCErrorCodes.UnsupportedEntitlementPullError;
|
||||
this.strCode = (0, error_utils_1.getErrorStringCode)(this.code);
|
||||
this.userMessage = `The custom rules feature is currently not supported for this org. To enable it, please contact snyk support.`;
|
||||
this.errorCatalog = new error_catalog_nodejs_public_1.CLI.GeneralIACFailureError('');
|
||||
}
|
||||
}
|
||||
exports.UnsupportedEntitlementPullError = UnsupportedEntitlementPullError;
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
};
|
||||
;
|
||||
//# sourceMappingURL=519.index.js.map
|
||||
1
safekiso-server/node_modules/snyk/dist/cli/519.index.js.map
generated
vendored
Normal file
1
safekiso-server/node_modules/snyk/dist/cli/519.index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
22
safekiso-server/node_modules/snyk/dist/cli/522.index.js
generated
vendored
Normal file
22
safekiso-server/node_modules/snyk/dist/cli/522.index.js
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
"use strict";
|
||||
exports.id = 522;
|
||||
exports.ids = [522];
|
||||
exports.modules = {
|
||||
|
||||
/***/ 1522:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
const theme = __webpack_require__(86988);
|
||||
function protectFunc() {
|
||||
console.log(theme.color.status.warn(`\n${theme.icon.WARNING} WARNING: Snyk protect was removed at 31 March 2022.\nPlease use '@snyk/protect' package instead: https://updates.snyk.io/snyk-wizard-and-snyk-protect-removal-224137 \n`));
|
||||
}
|
||||
exports["default"] = protectFunc;
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
};
|
||||
;
|
||||
//# sourceMappingURL=522.index.js.map
|
||||
1
safekiso-server/node_modules/snyk/dist/cli/522.index.js.map
generated
vendored
Normal file
1
safekiso-server/node_modules/snyk/dist/cli/522.index.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"522.index.js","mappings":";;;;;;;;;;AAAA,yCAA4C;AAE5C,SAAwB,WAAW;IACjC,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CACrB,KAAK,KAAK,CAAC,IAAI,CAAC,OAAO,0KAA0K,CAClM,CACF,CAAC;AACJ,CAAC;AAND,iCAMC","sources":["webpack://snyk/./src/cli/commands/protect/index.ts"],"sourcesContent":["import * as theme from '../../../lib/theme';\n\nexport default function protectFunc() {\n console.log(\n theme.color.status.warn(\n `\\n${theme.icon.WARNING} WARNING: Snyk protect was removed at 31 March 2022.\\nPlease use '@snyk/protect' package instead: https://updates.snyk.io/snyk-wizard-and-snyk-protect-removal-224137 \\n`,\n ),\n );\n}\n"],"names":[],"sourceRoot":""}
|
||||
404
safekiso-server/node_modules/snyk/dist/cli/532.index.js
generated
vendored
Normal file
404
safekiso-server/node_modules/snyk/dist/cli/532.index.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
safekiso-server/node_modules/snyk/dist/cli/532.index.js.map
generated
vendored
Normal file
1
safekiso-server/node_modules/snyk/dist/cli/532.index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
182
safekiso-server/node_modules/snyk/dist/cli/542.index.js
generated
vendored
Normal file
182
safekiso-server/node_modules/snyk/dist/cli/542.index.js
generated
vendored
Normal file
@@ -0,0 +1,182 @@
|
||||
"use strict";
|
||||
exports.id = 542;
|
||||
exports.ids = [542];
|
||||
exports.modules = {
|
||||
|
||||
/***/ 3542:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.excludeFilePathPattern = exports.ignoreIssue = void 0;
|
||||
const policy = __webpack_require__(13284);
|
||||
const chalk_1 = __webpack_require__(32589);
|
||||
const authorization = __webpack_require__(69943);
|
||||
const api_token_1 = __webpack_require__(95181);
|
||||
const is_ci_1 = __webpack_require__(10090);
|
||||
const misconfigured_auth_in_ci_error_1 = __webpack_require__(27747);
|
||||
const Debug = __webpack_require__(15158);
|
||||
const debug = Debug('snyk');
|
||||
function ignore(options) {
|
||||
debug('snyk ignore called with options: %O', options);
|
||||
try {
|
||||
(0, api_token_1.apiTokenExists)();
|
||||
}
|
||||
catch (err) {
|
||||
if ((0, is_ci_1.isCI)()) {
|
||||
throw (0, misconfigured_auth_in_ci_error_1.MisconfiguredAuthInCI)();
|
||||
}
|
||||
throw err;
|
||||
}
|
||||
return authorization
|
||||
.actionAllowed('cliIgnore', options)
|
||||
.then((cliIgnoreAuthorization) => {
|
||||
if (!cliIgnoreAuthorization.allowed) {
|
||||
debug('snyk ignore called when disallowed');
|
||||
console.log(chalk_1.default.bold.red(cliIgnoreAuthorization.reason));
|
||||
return;
|
||||
}
|
||||
const isFilePathProvided = !!options['file-path'];
|
||||
if (isFilePathProvided) {
|
||||
return excludeFilePathPattern(options);
|
||||
}
|
||||
return ignoreIssue(options);
|
||||
});
|
||||
}
|
||||
exports["default"] = ignore;
|
||||
function ignoreIssue(options) {
|
||||
if (!options.id) {
|
||||
throw Error('idRequired');
|
||||
}
|
||||
options.expiry = new Date(options.expiry);
|
||||
if (options.expiry.getTime() !== options.expiry.getTime()) {
|
||||
debug('No/invalid expiry given, using the default 30 days');
|
||||
options.expiry = new Date(Date.now() + 30 * 24 * 60 * 60 * 1000);
|
||||
}
|
||||
if (!options.reason) {
|
||||
options.reason = 'None Given';
|
||||
}
|
||||
const isPathProvided = !!options.path;
|
||||
if (!isPathProvided) {
|
||||
options.path = '*';
|
||||
}
|
||||
debug(`changing policy: ignore "%s", for %s, reason: "%s", until: %o`, options.id, isPathProvided ? 'all paths' : `path: '${options.path}'`, options.reason, options.expiry);
|
||||
return load(options['policy-path']).then(async (pol) => {
|
||||
var _a;
|
||||
let ignoreRulePathDataIdx = -1;
|
||||
const ignoreParams = {
|
||||
reason: options.reason,
|
||||
expires: options.expiry,
|
||||
created: new Date(),
|
||||
};
|
||||
const ignoreRules = pol.ignore;
|
||||
const issueIgnorePaths = (_a = ignoreRules[options.id]) !== null && _a !== void 0 ? _a : [];
|
||||
// Checking if the ignore-rule for this issue exists for the provided path.
|
||||
ignoreRulePathDataIdx = issueIgnorePaths.findIndex((ignoreMetadata) => !!ignoreMetadata[options.path]);
|
||||
// If an ignore-rule for this path doesn't exist, create one.
|
||||
if (ignoreRulePathDataIdx === -1) {
|
||||
issueIgnorePaths.push({
|
||||
[options.path]: ignoreParams,
|
||||
});
|
||||
}
|
||||
// Otherwise, update the existing rule's metadata.
|
||||
else {
|
||||
issueIgnorePaths[ignoreRulePathDataIdx][options.path] = ignoreParams;
|
||||
}
|
||||
ignoreRules[options.id] = issueIgnorePaths;
|
||||
pol.ignore = ignoreRules;
|
||||
return await policy.save(pol, options['policy-path']);
|
||||
});
|
||||
}
|
||||
exports.ignoreIssue = ignoreIssue;
|
||||
async function excludeFilePathPattern(options) {
|
||||
const pattern = options['file-path'];
|
||||
const group = options['file-path-group'] || 'global';
|
||||
const policyPath = options['policy-path'];
|
||||
const excludeOptions = {};
|
||||
if (options.reason !== undefined) {
|
||||
excludeOptions['reason'] = options.reason;
|
||||
}
|
||||
if (options.expiry !== undefined) {
|
||||
excludeOptions['expires'] = new Date(options.expiry);
|
||||
}
|
||||
debug(`changing policy: ignore "%s" added to "%s"`, pattern, policyPath);
|
||||
const pol = await load(policyPath);
|
||||
pol.addExclude(pattern, group, excludeOptions);
|
||||
return policy.save(pol, policyPath);
|
||||
}
|
||||
exports.excludeFilePathPattern = excludeFilePathPattern;
|
||||
async function load(path) {
|
||||
return policy.load(path).catch((error) => {
|
||||
if (error.code === 'ENOENT') {
|
||||
// file does not exist - create it
|
||||
return policy.create();
|
||||
}
|
||||
throw Error('policyFile');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 69943:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.actionAllowed = void 0;
|
||||
const api_token_1 = __webpack_require__(95181);
|
||||
const config_1 = __webpack_require__(25425);
|
||||
const request_1 = __webpack_require__(52050);
|
||||
async function actionAllowed(action, options) {
|
||||
const org = options.org || config_1.default.org || null;
|
||||
try {
|
||||
const res = await (0, request_1.makeRequest)({
|
||||
method: 'GET',
|
||||
url: config_1.default.API + '/authorization/' + action,
|
||||
json: true,
|
||||
headers: {
|
||||
authorization: (0, api_token_1.getAuthHeader)(),
|
||||
},
|
||||
qs: org && { org },
|
||||
});
|
||||
return res.body.result;
|
||||
}
|
||||
catch (err) {
|
||||
return {
|
||||
allowed: false,
|
||||
reason: 'There was an error while checking authorization',
|
||||
};
|
||||
}
|
||||
}
|
||||
exports.actionAllowed = actionAllowed;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 27747:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.MisconfiguredAuthInCI = void 0;
|
||||
const error_catalog_nodejs_public_1 = __webpack_require__(88404);
|
||||
const custom_error_1 = __webpack_require__(17188);
|
||||
function MisconfiguredAuthInCI() {
|
||||
const errorMsg = 'Snyk is missing auth token in order to run inside CI. You must include ' +
|
||||
'your API token as an environment value: `SNYK_TOKEN=12345678`';
|
||||
const error = new custom_error_1.CustomError(errorMsg);
|
||||
error.code = 401;
|
||||
error.strCode = 'noAuthInCI';
|
||||
error.userMessage = errorMsg;
|
||||
error.errorCatalog = new error_catalog_nodejs_public_1.CLI.AuthConfigError('');
|
||||
return error;
|
||||
}
|
||||
exports.MisconfiguredAuthInCI = MisconfiguredAuthInCI;
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
};
|
||||
;
|
||||
//# sourceMappingURL=542.index.js.map
|
||||
1
safekiso-server/node_modules/snyk/dist/cli/542.index.js.map
generated
vendored
Normal file
1
safekiso-server/node_modules/snyk/dist/cli/542.index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
7503
safekiso-server/node_modules/snyk/dist/cli/573.index.js
generated
vendored
Normal file
7503
safekiso-server/node_modules/snyk/dist/cli/573.index.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
safekiso-server/node_modules/snyk/dist/cli/573.index.js.map
generated
vendored
Normal file
1
safekiso-server/node_modules/snyk/dist/cli/573.index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
31
safekiso-server/node_modules/snyk/dist/cli/575.index.js
generated
vendored
Normal file
31
safekiso-server/node_modules/snyk/dist/cli/575.index.js
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
"use strict";
|
||||
exports.id = 575;
|
||||
exports.ids = [575];
|
||||
exports.modules = {
|
||||
|
||||
/***/ 77575:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
const fs = __webpack_require__(57147);
|
||||
const path = __webpack_require__(71017);
|
||||
function about() {
|
||||
console.log(`Snyk CLI Open Source Attributions\n\n`);
|
||||
const licenseNoticesArray = JSON.parse(fs.readFileSync(path.resolve(__dirname, 'thirdPartyNotice.json'), 'utf8'));
|
||||
for (const licenseNotice of licenseNoticesArray) {
|
||||
console.log(`${licenseNotice.name} \u00B7 ${licenseNotice.version} \u00B7 ${licenseNotice.license}`);
|
||||
console.log(`Author(s): ${licenseNotice.author || 'Not filled'} \u00B7 Package: ${licenseNotice.source || ''}`);
|
||||
console.log(`${licenseNotice.licenseText || ''}`); // WTFPL is not required the embed its license text
|
||||
console.log('\n+-+-+-+-+-+-+');
|
||||
console.log('\n');
|
||||
}
|
||||
}
|
||||
exports["default"] = about;
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
};
|
||||
;
|
||||
//# sourceMappingURL=575.index.js.map
|
||||
1
safekiso-server/node_modules/snyk/dist/cli/575.index.js.map
generated
vendored
Normal file
1
safekiso-server/node_modules/snyk/dist/cli/575.index.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"575.index.js","mappings":";;;;;;;;;;AAAA,sCAAyB;AACzB,wCAA6B;AAE7B,SAAwB,KAAK;IAC3B,OAAO,CAAC,GAAG,CAAC,uCAAuC,CAAC,CAAC;IACrD,MAAM,mBAAmB,GAAG,IAAI,CAAC,KAAK,CACpC,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,uBAAuB,CAAC,EAAE,MAAM,CAAC,CAC1E,CAAC;IACF,KAAK,MAAM,aAAa,IAAI,mBAAmB,EAAE;QAC/C,OAAO,CAAC,GAAG,CACT,GAAG,aAAa,CAAC,IAAI,WAAW,aAAa,CAAC,OAAO,WAAW,aAAa,CAAC,OAAO,EAAE,CACxF,CAAC;QACF,OAAO,CAAC,GAAG,CACT,cACE,aAAa,CAAC,MAAM,IAAI,YAC1B,oBAAoB,aAAa,CAAC,MAAM,IAAI,EAAE,EAAE,CACjD,CAAC;QACF,OAAO,CAAC,GAAG,CAAC,GAAG,aAAa,CAAC,WAAW,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,mDAAmD;QACtG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC/B,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;KACnB;AACH,CAAC;AAlBD,2BAkBC","sources":["webpack://snyk/./src/cli/commands/about.ts"],"sourcesContent":["import * as fs from 'fs';\nimport * as path from 'path';\n\nexport default function about(): void {\n console.log(`Snyk CLI Open Source Attributions\\n\\n`);\n const licenseNoticesArray = JSON.parse(\n fs.readFileSync(path.resolve(__dirname, 'thirdPartyNotice.json'), 'utf8'),\n );\n for (const licenseNotice of licenseNoticesArray) {\n console.log(\n `${licenseNotice.name} \\u00B7 ${licenseNotice.version} \\u00B7 ${licenseNotice.license}`,\n );\n console.log(\n `Author(s): ${\n licenseNotice.author || 'Not filled'\n } \\u00B7 Package: ${licenseNotice.source || ''}`,\n );\n console.log(`${licenseNotice.licenseText || ''}`); // WTFPL is not required the embed its license text\n console.log('\\n+-+-+-+-+-+-+');\n console.log('\\n');\n }\n}\n"],"names":[],"sourceRoot":""}
|
||||
1020
safekiso-server/node_modules/snyk/dist/cli/617.index.js
generated
vendored
Normal file
1020
safekiso-server/node_modules/snyk/dist/cli/617.index.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
safekiso-server/node_modules/snyk/dist/cli/617.index.js.map
generated
vendored
Normal file
1
safekiso-server/node_modules/snyk/dist/cli/617.index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
930
safekiso-server/node_modules/snyk/dist/cli/663.index.js
generated
vendored
Normal file
930
safekiso-server/node_modules/snyk/dist/cli/663.index.js
generated
vendored
Normal file
@@ -0,0 +1,930 @@
|
||||
"use strict";
|
||||
exports.id = 663;
|
||||
exports.ids = [663,85];
|
||||
exports.modules = {
|
||||
|
||||
/***/ 29430:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.createApp = void 0;
|
||||
const Debug = __webpack_require__(15158);
|
||||
const apps_1 = __webpack_require__(14589);
|
||||
const promise_1 = __webpack_require__(90430);
|
||||
const spinner_1 = __webpack_require__(86766);
|
||||
const debug = Debug(apps_1.SNYK_APP_DEBUG);
|
||||
/**
|
||||
* Function to process the app creation request and
|
||||
* handle any errors that are request error and print
|
||||
* in a formatted string. It throws is error is unknown
|
||||
* or cannot be handled.
|
||||
* @param {ICreateAppRequest} data to create the app
|
||||
* @returns {String} response formatted string
|
||||
*/
|
||||
async function createApp(data) {
|
||||
debug('App data', data);
|
||||
const { orgId, snykAppName: name, snykAppRedirectUris: redirectUris, snykAppScopes: scopes, context, } = data;
|
||||
const payload = {
|
||||
method: 'POST',
|
||||
url: (0, apps_1.getAppsURL)(apps_1.EAppsURL.CREATE_APP, { orgId }),
|
||||
body: {
|
||||
name,
|
||||
redirect_uris: redirectUris,
|
||||
scopes,
|
||||
context,
|
||||
},
|
||||
qs: {
|
||||
version: '2022-03-11~experimental',
|
||||
},
|
||||
noCompression: true,
|
||||
};
|
||||
try {
|
||||
await (0, spinner_1.spinner)('Creating your Snyk App');
|
||||
const response = await (0, promise_1.makeRequestRest)(payload);
|
||||
debug(response);
|
||||
spinner_1.spinner.clearAll();
|
||||
return (0, apps_1.handleCreateAppRes)(response);
|
||||
}
|
||||
catch (error) {
|
||||
spinner_1.spinner.clearAll();
|
||||
(0, apps_1.handleRestError)(error);
|
||||
}
|
||||
}
|
||||
exports.createApp = createApp;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 68458:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
const Debug = __webpack_require__(15158);
|
||||
const process_command_args_1 = __webpack_require__(52369);
|
||||
const apps_1 = __webpack_require__(14589);
|
||||
const create_app_1 = __webpack_require__(29430);
|
||||
// import * as path from 'path';
|
||||
const create_app_2 = __webpack_require__(38276);
|
||||
const help_1 = __webpack_require__(21085);
|
||||
const debug = Debug(apps_1.SNYK_APP_DEBUG);
|
||||
async function apps(...args0) {
|
||||
debug('Snyk apps CLI called');
|
||||
const { options, paths } = (0, process_command_args_1.processCommandArgs)(...args0);
|
||||
debug(options, paths);
|
||||
const commandVerb1 = paths[0];
|
||||
const validCommandVerb = commandVerb1 && apps_1.validAppsSubCommands.includes(commandVerb1);
|
||||
if (!validCommandVerb) {
|
||||
// Display help md for apps
|
||||
debug(`Unknown subcommand: ${commandVerb1}`);
|
||||
return (0, help_1.default)('apps');
|
||||
}
|
||||
// Check if experimental flag is being used
|
||||
if (!options.experimental)
|
||||
throw new Error(apps_1.AppsErrorMessages.useExperimental);
|
||||
if (commandVerb1 === apps_1.EValidSubCommands.CREATE) {
|
||||
const createAppData = options.interactive
|
||||
? await (0, create_app_2.createAppDataInteractive)()
|
||||
: (0, create_app_2.createAppDataScriptable)(options);
|
||||
return await (0, create_app_1.createApp)(createAppData);
|
||||
}
|
||||
}
|
||||
exports["default"] = apps;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 21085:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.findHelpFile = void 0;
|
||||
const fs = __webpack_require__(57147);
|
||||
const path = __webpack_require__(71017);
|
||||
const markdown_renderer_1 = __webpack_require__(99387);
|
||||
function findHelpFile(helpArgs, helpFolderPath = '../../help/cli-commands') {
|
||||
while (helpArgs.length > 0) {
|
||||
// cleanse the filename to only contain letters
|
||||
// aka: /\W/g but figured this was easier to read
|
||||
const file = `${helpArgs.join('-').replace(/[^a-z0-9-]/gi, '')}.md`;
|
||||
const testHelpAbsolutePath = path.resolve(__dirname, helpFolderPath, file);
|
||||
if (fs.existsSync(testHelpAbsolutePath)) {
|
||||
return testHelpAbsolutePath;
|
||||
}
|
||||
helpArgs = helpArgs.slice(0, -1);
|
||||
}
|
||||
return path.resolve(__dirname, helpFolderPath, `README.md`); // Default help file
|
||||
}
|
||||
exports.findHelpFile = findHelpFile;
|
||||
async function help(...args) {
|
||||
const helpArgs = args.filter((arg) => typeof arg === 'string');
|
||||
const helpFileAbsolutePath = findHelpFile(helpArgs);
|
||||
return (0, markdown_renderer_1.renderMarkdown)(fs.readFileSync(helpFileAbsolutePath, 'utf8'));
|
||||
}
|
||||
exports["default"] = help;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 99387:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.renderMarkdown = void 0;
|
||||
const marked_1 = __webpack_require__(30970);
|
||||
const chalk_1 = __webpack_require__(32589);
|
||||
const reflow_text_1 = __webpack_require__(67211);
|
||||
// stateful variable to control left-padding by header level
|
||||
let currentHeader = 1;
|
||||
const listItemSeparator = 'LISTITEMSEPARATOR'; // Helper string for rendering ListItems
|
||||
/**
|
||||
* @description get padding spaces depending on the last header level used
|
||||
* @returns string
|
||||
*/
|
||||
function getLeftTextPadding() {
|
||||
return ' '.repeat(currentHeader === 1 || currentHeader === 2 ? 1 : currentHeader - 1);
|
||||
}
|
||||
/**
|
||||
* @description Reads current terminal width if available to limit column width for text-reflowing
|
||||
* @returns {number}
|
||||
*/
|
||||
const defaultMaximumLineWidth = 100;
|
||||
function getIdealTextWidth(maximumLineWidth = defaultMaximumLineWidth) {
|
||||
if (typeof process.stdout.columns === 'number') {
|
||||
if (process.stdout.columns < maximumLineWidth) {
|
||||
return process.stdout.columns - getLeftTextPadding().length - 5;
|
||||
}
|
||||
}
|
||||
return maximumLineWidth - getLeftTextPadding().length;
|
||||
}
|
||||
// Marked custom renderer class
|
||||
const renderer = {
|
||||
em(text) {
|
||||
return chalk_1.default.italic(text);
|
||||
},
|
||||
strong(text) {
|
||||
return chalk_1.default.bold(text);
|
||||
},
|
||||
link(href, title, text) {
|
||||
// Don't render links to relative paths (like local files)
|
||||
if (href.startsWith('./') || !href.includes('://')) {
|
||||
return text;
|
||||
}
|
||||
const renderedLink = chalk_1.default.bold.blueBright(href);
|
||||
if (text && text !== href) {
|
||||
return `${text} ${renderedLink}`;
|
||||
}
|
||||
return renderedLink;
|
||||
},
|
||||
blockquote(quote) {
|
||||
return quote;
|
||||
},
|
||||
list(body, ordered, start) {
|
||||
return (body
|
||||
.split(listItemSeparator)
|
||||
.map((listItem, listItemIndex) => {
|
||||
const bulletPoint = ordered ? `${listItemIndex + start}. ` : '- ';
|
||||
return (0, reflow_text_1.reflowText)(listItem, getIdealTextWidth())
|
||||
.split('\n')
|
||||
.map((listItemLine, listItemLineIndex) => {
|
||||
if (!listItemLine) {
|
||||
return '';
|
||||
}
|
||||
return `${getLeftTextPadding()}${listItemLineIndex === 0 ? bulletPoint : ' '}${listItemLine}`;
|
||||
})
|
||||
.join('\n');
|
||||
})
|
||||
.join('\n') + '\n');
|
||||
},
|
||||
listitem(text) {
|
||||
return text + listItemSeparator;
|
||||
},
|
||||
paragraph(text) {
|
||||
return ((0, reflow_text_1.reflowText)(text, getIdealTextWidth())
|
||||
.split('\n')
|
||||
.map((s) => getLeftTextPadding() + chalk_1.default.reset() + s)
|
||||
.join('\n') + '\n\n');
|
||||
},
|
||||
codespan(text) {
|
||||
return chalk_1.default.italic.blueBright(`${text}`);
|
||||
},
|
||||
code(code) {
|
||||
return (code
|
||||
.split('\n')
|
||||
.map((s) => getLeftTextPadding() + chalk_1.default.reset() + s)
|
||||
.join('\n') + '\n\n');
|
||||
},
|
||||
heading(text, level) {
|
||||
currentHeader = level;
|
||||
let coloring;
|
||||
switch (level) {
|
||||
case 1:
|
||||
coloring = chalk_1.default.bold.underline;
|
||||
break;
|
||||
case 3:
|
||||
case 4:
|
||||
coloring = chalk_1.default;
|
||||
break;
|
||||
default:
|
||||
coloring = chalk_1.default.bold;
|
||||
break;
|
||||
}
|
||||
return `${' '.repeat(level === 1 ? 0 : currentHeader - 2)}${coloring(text)}\n`;
|
||||
},
|
||||
};
|
||||
marked_1.marked.use({ renderer });
|
||||
marked_1.marked.setOptions({
|
||||
mangle: false,
|
||||
});
|
||||
const htmlUnescapes = {
|
||||
'&': '&',
|
||||
'<': '<',
|
||||
'>': '>',
|
||||
'"': '"',
|
||||
''': "'",
|
||||
'`': '`',
|
||||
' ': '',
|
||||
};
|
||||
/**
|
||||
* @description Replace HTML entities with their non-encoded variant
|
||||
* @param {string} text
|
||||
* @returns {string}
|
||||
*/
|
||||
function unescape(text) {
|
||||
Object.entries(htmlUnescapes).forEach(([escapedChar, unescapedChar]) => {
|
||||
const escapedCharRegExp = new RegExp(escapedChar, 'g');
|
||||
text = text.replace(escapedCharRegExp, unescapedChar);
|
||||
});
|
||||
return text;
|
||||
}
|
||||
function renderMarkdown(markdown) {
|
||||
return unescape(marked_1.marked.parse(markdown));
|
||||
}
|
||||
exports.renderMarkdown = renderMarkdown;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 67211:
|
||||
/***/ ((__unused_webpack_module, exports) => {
|
||||
|
||||
|
||||
/**
|
||||
Code in this file is adapted from mikaelbr/marked-terminal
|
||||
https://github.com/mikaelbr/marked-terminal/blob/7501b8bb24a5ed52ec7d9114d4aeefa14f1bf5e6/index.js#L234-L330
|
||||
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2017 Mikael Brevik
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.reflowText = void 0;
|
||||
// Compute length of str not including ANSI escape codes.
|
||||
// See http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
|
||||
function textLength(str) {
|
||||
// eslint-disable-next-line no-control-regex
|
||||
return str.replace(/\u001b\[(?:\d{1,3})(?:;\d{1,3})*m/g, '').length;
|
||||
}
|
||||
// Munge \n's and spaces in "text" so that the number of
|
||||
// characters between \n's is less than or equal to "width".
|
||||
function reflowText(text, width) {
|
||||
const HARD_RETURN = '\r|\n';
|
||||
const HARD_RETURN_GFM_RE = new RegExp(HARD_RETURN + '|<br ?/?>');
|
||||
const splitRe = HARD_RETURN_GFM_RE;
|
||||
const sections = text.split(splitRe);
|
||||
const reflowed = [];
|
||||
sections.forEach((section) => {
|
||||
// Split the section by escape codes so that we can
|
||||
// deal with them separately.
|
||||
// eslint-disable-next-line no-control-regex
|
||||
const fragments = section.split(/(\u001b\[(?:\d{1,3})(?:;\d{1,3})*m)/g);
|
||||
let column = 0;
|
||||
let currentLine = '';
|
||||
let lastWasEscapeChar = false;
|
||||
while (fragments.length) {
|
||||
const fragment = fragments[0];
|
||||
if (fragment === '') {
|
||||
fragments.splice(0, 1);
|
||||
lastWasEscapeChar = false;
|
||||
continue;
|
||||
}
|
||||
// This is an escape code - leave it whole and
|
||||
// move to the next fragment.
|
||||
if (!textLength(fragment)) {
|
||||
currentLine += fragment;
|
||||
fragments.splice(0, 1);
|
||||
lastWasEscapeChar = true;
|
||||
continue;
|
||||
}
|
||||
const words = fragment.split(/[ \t\n]+/);
|
||||
for (let i = 0; i < words.length; i++) {
|
||||
let word = words[i];
|
||||
let addSpace = column != 0;
|
||||
if (lastWasEscapeChar)
|
||||
addSpace = false;
|
||||
// If adding the new word overflows the required width
|
||||
if (column + word.length > width) {
|
||||
if (word.length <= width) {
|
||||
// If the new word is smaller than the required width
|
||||
// just add it at the beginning of a new line
|
||||
reflowed.push(currentLine);
|
||||
currentLine = word;
|
||||
column = word.length;
|
||||
}
|
||||
else {
|
||||
// If the new word is longer than the required width
|
||||
// split this word into smaller parts.
|
||||
const w = word.substr(0, width - column);
|
||||
if (addSpace)
|
||||
currentLine += ' ';
|
||||
currentLine += w;
|
||||
reflowed.push(currentLine);
|
||||
currentLine = '';
|
||||
column = 0;
|
||||
word = word.substr(w.length);
|
||||
while (word.length) {
|
||||
const w = word.substr(0, width);
|
||||
if (!w.length)
|
||||
break;
|
||||
if (w.length < width) {
|
||||
currentLine = w;
|
||||
column = w.length;
|
||||
break;
|
||||
}
|
||||
else {
|
||||
reflowed.push(w);
|
||||
word = word.substr(width);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (addSpace) {
|
||||
currentLine += ' ';
|
||||
column++;
|
||||
}
|
||||
currentLine += word;
|
||||
column += word.length;
|
||||
}
|
||||
lastWasEscapeChar = false;
|
||||
}
|
||||
fragments.splice(0, 1);
|
||||
}
|
||||
if (textLength(currentLine))
|
||||
reflowed.push(currentLine);
|
||||
});
|
||||
return reflowed.join('\n');
|
||||
}
|
||||
exports.reflowText = reflowText;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 52369:
|
||||
/***/ ((__unused_webpack_module, exports) => {
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.processCommandArgs = void 0;
|
||||
function processCommandArgs(...args) {
|
||||
let options = {};
|
||||
if (typeof args[args.length - 1] === 'object') {
|
||||
options = args.pop();
|
||||
}
|
||||
args = args.filter(Boolean);
|
||||
// For repository scanning, populate with default path (cwd) if no path given
|
||||
if (args.length === 0 && !options.docker) {
|
||||
args.unshift(process.cwd());
|
||||
}
|
||||
return { options, paths: args };
|
||||
}
|
||||
exports.processCommandArgs = processCommandArgs;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 89019:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.CreateAppPromptData = exports.AppsErrorMessages = exports.validAppsSubCommands = exports.EAppsURL = exports.EValidSubCommands = exports.SNYK_APP_DEBUG = exports.SNYK_APP_CONTEXT = exports.SNYK_APP_ORG_ID = exports.SNYK_APP_CLIENT_ID = exports.SNYK_APP_SCOPES = exports.SNYK_APP_REDIRECT_URIS = exports.SNYK_APP_NAME = void 0;
|
||||
const chalk_1 = __webpack_require__(32589);
|
||||
exports.SNYK_APP_NAME = 'snykAppName';
|
||||
exports.SNYK_APP_REDIRECT_URIS = 'snykAppRedirectUris';
|
||||
exports.SNYK_APP_SCOPES = 'snykAppScopes';
|
||||
exports.SNYK_APP_CLIENT_ID = 'snykAppClientId';
|
||||
exports.SNYK_APP_ORG_ID = 'snykAppOrgId';
|
||||
exports.SNYK_APP_CONTEXT = 'context';
|
||||
exports.SNYK_APP_DEBUG = 'snyk:apps';
|
||||
var EValidSubCommands;
|
||||
(function (EValidSubCommands) {
|
||||
EValidSubCommands["CREATE"] = "create";
|
||||
})(EValidSubCommands = exports.EValidSubCommands || (exports.EValidSubCommands = {}));
|
||||
var EAppsURL;
|
||||
(function (EAppsURL) {
|
||||
EAppsURL[EAppsURL["CREATE_APP"] = 0] = "CREATE_APP";
|
||||
})(EAppsURL = exports.EAppsURL || (exports.EAppsURL = {}));
|
||||
exports.validAppsSubCommands = Object.values(EValidSubCommands);
|
||||
exports.AppsErrorMessages = {
|
||||
orgRequired: `Option '--org' is required! For interactive mode, please use '--interactive' or '-i' flag. For more information please run the help command 'snyk apps --help' or 'snyk apps -h'.`,
|
||||
nameRequired: `Option '--name' is required! For interactive mode, please use '--interactive' or '-i' flag. For more information please run the help command 'snyk apps --help' or 'snyk apps -h'.`,
|
||||
redirectUrisRequired: `Option '--redirect-uris' is required! For interactive mode, please use '--interactive' or '-i' flag. For more information please run the help command 'snyk apps --help' or 'snyk apps -h'.`,
|
||||
scopesRequired: `Option '--scopes' is required! For interactive mode, please use '--interactive' or '-i' flag. For more information please run the help command 'snyk apps --help' or 'snyk apps -h'.`,
|
||||
invalidContext: `Option '--context' must be either 'tenant' or 'user'! For interactive mode, please use '--interactive' or '-i' flag. For more information please run the help command 'snyk apps --help' or 'snyk apps -h'.`,
|
||||
useExperimental: `\n${chalk_1.default.redBright("All 'apps' commands are only accessible behind the '--experimental' flag.")}\n
|
||||
The behaviour can change at any time, without prior notice.
|
||||
You are kindly advised to use all the commands with caution.
|
||||
|
||||
${chalk_1.default.bold('Usage')}
|
||||
${chalk_1.default.italic('snyk apps <COMMAND> --experimental')}\n`,
|
||||
};
|
||||
exports.CreateAppPromptData = {
|
||||
SNYK_APP_NAME: {
|
||||
name: exports.SNYK_APP_NAME,
|
||||
message: `Name of the Snyk App (visible to users when they install the Snyk App)?`,
|
||||
},
|
||||
SNYK_APP_REDIRECT_URIS: {
|
||||
name: exports.SNYK_APP_REDIRECT_URIS,
|
||||
message: `Your Snyk App's redirect URIs (comma seprated list. ${chalk_1.default.yellowBright(' Ex: https://example1.com,https://example2.com')})?: `,
|
||||
},
|
||||
SNYK_APP_SCOPES: {
|
||||
name: exports.SNYK_APP_SCOPES,
|
||||
message: `Your Snyk App's permission scopes (comma separated list. ${chalk_1.default.yellowBright(' Ex: org.read,org.report.read')})?: `,
|
||||
},
|
||||
SNYK_APP_ORG_ID: {
|
||||
name: exports.SNYK_APP_ORG_ID,
|
||||
message: 'Please provide the org id under which you want to create your Snyk App: ',
|
||||
},
|
||||
SNYK_APP_CONTEXT: {
|
||||
name: exports.SNYK_APP_CONTEXT,
|
||||
message: 'Which context will your app operate under: ',
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 38276:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.createAppDataInteractive = exports.createAppDataScriptable = void 0;
|
||||
const __1 = __webpack_require__(14589);
|
||||
const enquirer = __webpack_require__(84031);
|
||||
const errors_1 = __webpack_require__(55191);
|
||||
/**
|
||||
* Validates and parsed the data required to create app.
|
||||
* Throws error if option is not provided or is invalid
|
||||
* @param {ICreateAppOptions} options required to create an app
|
||||
* @returns {ICreateAppRequest} data that is used to make the request
|
||||
*/
|
||||
function createAppDataScriptable(options) {
|
||||
if (!options.org) {
|
||||
throw new errors_1.ValidationError(__1.AppsErrorMessages.orgRequired);
|
||||
}
|
||||
else if (typeof (0, __1.validateUUID)(options.org) === 'string') {
|
||||
// Combines to form "Invalid UUID provided for org id"
|
||||
throw new errors_1.ValidationError(`${(0, __1.validateUUID)(options.org)} for org id`);
|
||||
}
|
||||
else if (!options.name) {
|
||||
throw new errors_1.ValidationError(__1.AppsErrorMessages.nameRequired);
|
||||
}
|
||||
else if (!options['redirect-uris']) {
|
||||
throw new errors_1.ValidationError(__1.AppsErrorMessages.redirectUrisRequired);
|
||||
}
|
||||
else if (typeof (0, __1.validateAllURL)(options['redirect-uris']) === 'string') {
|
||||
throw new errors_1.ValidationError((0, __1.validateAllURL)(options['redirect-uris']));
|
||||
}
|
||||
else if (!options.scopes) {
|
||||
throw new errors_1.ValidationError(__1.AppsErrorMessages.scopesRequired);
|
||||
}
|
||||
else if (options.context != null &&
|
||||
!(options.context == 'user' || options.context == 'tenant')) {
|
||||
throw new errors_1.ValidationError(__1.AppsErrorMessages.invalidContext);
|
||||
}
|
||||
else {
|
||||
return {
|
||||
orgId: options.org,
|
||||
snykAppName: options.name,
|
||||
snykAppRedirectUris: options['redirect-uris']
|
||||
.replace(/\s+/g, '')
|
||||
.split(','),
|
||||
snykAppScopes: options.scopes.replace(/\s+/g, '').split(','),
|
||||
context: options.context,
|
||||
};
|
||||
}
|
||||
}
|
||||
exports.createAppDataScriptable = createAppDataScriptable;
|
||||
// Interactive format
|
||||
async function createAppDataInteractive() {
|
||||
// Proceed with interactive
|
||||
const answers = await enquirer.prompt(__1.createAppPrompts);
|
||||
// Process answers
|
||||
const snykAppName = answers[__1.SNYK_APP_NAME].trim();
|
||||
const snykAppRedirectUris = answers[__1.SNYK_APP_REDIRECT_URIS].replace(/\s+/g, '').split(',');
|
||||
const snykAppScopes = answers[__1.SNYK_APP_SCOPES].replace(/\s+/g, '').split(',');
|
||||
const orgId = answers[__1.SNYK_APP_ORG_ID].trim();
|
||||
const context = answers[__1.SNYK_APP_CONTEXT].trim();
|
||||
// POST: to create an app
|
||||
return {
|
||||
orgId,
|
||||
snykAppName,
|
||||
snykAppRedirectUris,
|
||||
snykAppScopes,
|
||||
context,
|
||||
};
|
||||
}
|
||||
exports.createAppDataInteractive = createAppDataInteractive;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 14589:
|
||||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||||
|
||||
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
__exportStar(__webpack_require__(89019), exports);
|
||||
__exportStar(__webpack_require__(86950), exports);
|
||||
__exportStar(__webpack_require__(31940), exports);
|
||||
__exportStar(__webpack_require__(72511), exports);
|
||||
__exportStar(__webpack_require__(46693), exports);
|
||||
__exportStar(__webpack_require__(8864), exports);
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 8864:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.validInput = exports.validateUUID = exports.validURL = exports.validateAllURL = void 0;
|
||||
const uuid = __webpack_require__(96771);
|
||||
/**
|
||||
*
|
||||
* @param {String} input of space separated URL/URI passed by
|
||||
* user for redirect URIs
|
||||
* @returns { String | Boolean } complying with enquirer return values, the function
|
||||
* separates the string on space and validates each to see
|
||||
* if a valid URL/URI. Return a string if invalid and
|
||||
* boolean true if valid
|
||||
*/
|
||||
function validateAllURL(input) {
|
||||
const trimmedInput = input.trim();
|
||||
let errMessage = '';
|
||||
for (const i of trimmedInput.split(',')) {
|
||||
if (typeof validURL(i) == 'string')
|
||||
errMessage = errMessage + `\n${validURL(i)}`;
|
||||
}
|
||||
if (errMessage)
|
||||
return errMessage;
|
||||
return true;
|
||||
}
|
||||
exports.validateAllURL = validateAllURL;
|
||||
/**
|
||||
* Custom validation logic which takes in consideration
|
||||
* creation of Snyk Apps and thus allows localhost.com
|
||||
* as a valid URL.
|
||||
* @param {String} input of URI/URL value to validate using
|
||||
* regex
|
||||
* @returns {String | Boolean } string message is not valid
|
||||
* and boolean true if valid
|
||||
*/
|
||||
function validURL(input) {
|
||||
try {
|
||||
new URL(input);
|
||||
return true;
|
||||
}
|
||||
catch (error) {
|
||||
return `${input} is not a valid URL`;
|
||||
}
|
||||
}
|
||||
exports.validURL = validURL;
|
||||
/**
|
||||
* Function validates if a valid UUID (version of UUID not tacken into account)
|
||||
* @param {String} input UUID to be validated
|
||||
* @returns {String | Boolean } string message is not valid
|
||||
* and boolean true if valid
|
||||
*/
|
||||
function validateUUID(input) {
|
||||
return uuid.validate(input) ? true : 'Invalid UUID provided';
|
||||
}
|
||||
exports.validateUUID = validateUUID;
|
||||
/**
|
||||
* @param {String} input
|
||||
* @returns {String | Boolean } string message is not valid
|
||||
* and boolean true if valid
|
||||
*/
|
||||
function validInput(input) {
|
||||
if (!input)
|
||||
return 'Please enter something';
|
||||
return true;
|
||||
}
|
||||
exports.validInput = validInput;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 86950:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.createAppPrompts = void 0;
|
||||
const constants_1 = __webpack_require__(89019);
|
||||
const input_validator_1 = __webpack_require__(8864);
|
||||
/**
|
||||
* Prompts for $snyk apps create command
|
||||
*/
|
||||
exports.createAppPrompts = [
|
||||
{
|
||||
name: constants_1.CreateAppPromptData.SNYK_APP_NAME.name,
|
||||
type: 'input',
|
||||
message: constants_1.CreateAppPromptData.SNYK_APP_NAME.message,
|
||||
validate: input_validator_1.validInput,
|
||||
},
|
||||
{
|
||||
name: constants_1.CreateAppPromptData.SNYK_APP_REDIRECT_URIS.name,
|
||||
type: 'input',
|
||||
message: constants_1.CreateAppPromptData.SNYK_APP_REDIRECT_URIS.message,
|
||||
validate: input_validator_1.validateAllURL,
|
||||
},
|
||||
{
|
||||
name: constants_1.CreateAppPromptData.SNYK_APP_SCOPES.name,
|
||||
type: 'input',
|
||||
message: constants_1.CreateAppPromptData.SNYK_APP_SCOPES.message,
|
||||
validate: input_validator_1.validInput,
|
||||
},
|
||||
{
|
||||
name: constants_1.CreateAppPromptData.SNYK_APP_ORG_ID.name,
|
||||
type: 'input',
|
||||
message: constants_1.CreateAppPromptData.SNYK_APP_ORG_ID.message,
|
||||
validate: input_validator_1.validateUUID,
|
||||
},
|
||||
{
|
||||
name: constants_1.CreateAppPromptData.SNYK_APP_CONTEXT.name,
|
||||
type: 'select',
|
||||
message: constants_1.CreateAppPromptData.SNYK_APP_CONTEXT.message,
|
||||
choices: ['tenant', 'user'],
|
||||
initial: 'tenant',
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 72511:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.handleCreateAppRes = exports.handleRestError = exports.getAppsURL = void 0;
|
||||
/**
|
||||
* Collection of utility function for the
|
||||
* $snyk apps commands
|
||||
*/
|
||||
const _1 = __webpack_require__(14589);
|
||||
const chalk_1 = __webpack_require__(32589);
|
||||
const errors_1 = __webpack_require__(55191);
|
||||
const Debug = __webpack_require__(15158);
|
||||
const config_1 = __webpack_require__(25425);
|
||||
const debug = Debug(_1.SNYK_APP_DEBUG);
|
||||
function getAppsURL(selection, opts = {}) {
|
||||
// Get the rest URL from user config
|
||||
// Environment variable takes precendence over config
|
||||
const baseURL = config_1.default.API_REST_URL;
|
||||
debug(`API rest base URL => ${baseURL}`);
|
||||
switch (selection) {
|
||||
case _1.EAppsURL.CREATE_APP:
|
||||
return `${baseURL}/orgs/${opts.orgId}/apps`;
|
||||
default:
|
||||
throw new Error('Invalid selection for URL');
|
||||
}
|
||||
}
|
||||
exports.getAppsURL = getAppsURL;
|
||||
function handleRestError(error) {
|
||||
if (error.code) {
|
||||
if (error.code === 400) {
|
||||
// Bad request
|
||||
const responseJSON = error.body;
|
||||
const errString = errorsToDisplayString(responseJSON);
|
||||
throw new Error(errString);
|
||||
}
|
||||
else if (error.code === 401) {
|
||||
// Unauthorized
|
||||
throw (0, errors_1.AuthFailedError)();
|
||||
}
|
||||
else if (error.code === 403) {
|
||||
throw new Error('Forbidden! the authentication token does not have access to the resource.');
|
||||
}
|
||||
else if (error.code === 404) {
|
||||
const responseJSON = error.body;
|
||||
const errString = errorsToDisplayString(responseJSON);
|
||||
throw new Error(errString);
|
||||
}
|
||||
else if (error.code === 500) {
|
||||
throw new errors_1.InternalServerError('Internal server error');
|
||||
}
|
||||
else {
|
||||
throw new Error(error.message);
|
||||
}
|
||||
}
|
||||
else {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
exports.handleRestError = handleRestError;
|
||||
/**
|
||||
* @param errRes RestError response
|
||||
* @returns {String} Iterates over error and
|
||||
* converts them into a readible string
|
||||
*/
|
||||
function errorsToDisplayString(errRes) {
|
||||
const resString = `Uh oh! an error occurred while trying to create the Snyk App.
|
||||
Please run the command with '--debug' or '-d' to get more information`;
|
||||
if (!errRes.errors)
|
||||
return resString;
|
||||
errRes.errors.forEach((e) => {
|
||||
let metaString = '', sourceString = '';
|
||||
if (e.meta) {
|
||||
for (const [key, value] of Object.entries(e.meta)) {
|
||||
metaString += `${key}: ${value}\n`;
|
||||
}
|
||||
}
|
||||
if (e.source) {
|
||||
for (const [key, value] of Object.entries(e.source)) {
|
||||
sourceString += `${key}: ${value}\n`;
|
||||
}
|
||||
}
|
||||
const meta = metaString || '-';
|
||||
const source = sourceString || '-';
|
||||
return `Uh oh! an error occured while trying to create the Snyk App.
|
||||
|
||||
Error Description:\t${e.detail}
|
||||
Request Status:\t${e.status}
|
||||
Source:\t${source}
|
||||
Meta:\t${meta}`;
|
||||
});
|
||||
return resString;
|
||||
}
|
||||
function handleCreateAppRes(res) {
|
||||
debug(res);
|
||||
const { name, client_id, redirect_uris, scopes, is_public, client_secret, access_token_ttl_seconds, } = res.data.attributes;
|
||||
return `Snyk App created successfully!
|
||||
Please ensure you save the following details:
|
||||
|
||||
App Name: ${name}
|
||||
Client ID: ${client_id}
|
||||
Redirect URIs: ${redirect_uris}
|
||||
Scopes: ${scopes}
|
||||
Is App Public: ${is_public}
|
||||
Access token TTL seconds: ${access_token_ttl_seconds}
|
||||
Client Secret (${chalk_1.default.redBright('keep it safe and protected')}): ${client_secret}`;
|
||||
}
|
||||
exports.handleCreateAppRes = handleCreateAppRes;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 31940:
|
||||
/***/ ((__unused_webpack_module, exports) => {
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 46693:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.readAppsHelpMarkdown = void 0;
|
||||
const fs = __webpack_require__(57147);
|
||||
const markdown_renderer_1 = __webpack_require__(99387);
|
||||
function readAppsHelpMarkdown(filename) {
|
||||
const file = fs.readFileSync(filename, 'utf8');
|
||||
return (0, markdown_renderer_1.renderMarkdown)(file);
|
||||
}
|
||||
exports.readAppsHelpMarkdown = readAppsHelpMarkdown;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 90430:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.makeRequestRest = exports.makeRequest = void 0;
|
||||
const exit_codes_1 = __webpack_require__(80079);
|
||||
const api_token_1 = __webpack_require__(95181);
|
||||
const errors_1 = __webpack_require__(55191);
|
||||
const constants_1 = __webpack_require__(13899);
|
||||
const request = __webpack_require__(52050);
|
||||
async function makeRequest(payload) {
|
||||
return new Promise((resolve, reject) => {
|
||||
request.makeRequest(payload, (error, res, body) => {
|
||||
if (res.headers[constants_1.headerSnykTsCliTerminate] == 'true') {
|
||||
process.exit(exit_codes_1.EXIT_CODES.EX_TERMINATE);
|
||||
}
|
||||
if (error) {
|
||||
return reject(error);
|
||||
}
|
||||
if (res.statusCode !== 200) {
|
||||
return reject({
|
||||
code: res.statusCode,
|
||||
message: body === null || body === void 0 ? void 0 : body.message,
|
||||
});
|
||||
}
|
||||
resolve(body);
|
||||
});
|
||||
});
|
||||
}
|
||||
exports.makeRequest = makeRequest;
|
||||
/**
|
||||
* All rest request will essentially be the same and are JSON by default
|
||||
* Thus if no headers provided default headers are used
|
||||
* @param {any} payload for the request
|
||||
* @returns
|
||||
*/
|
||||
async function makeRequestRest(payload) {
|
||||
return new Promise((resolve, reject) => {
|
||||
var _a;
|
||||
payload.headers = (_a = payload.headers) !== null && _a !== void 0 ? _a : {
|
||||
'Content-Type': 'application/vnd.api+json',
|
||||
authorization: (0, api_token_1.getAuthHeader)(),
|
||||
};
|
||||
payload.json = true;
|
||||
payload.parse = false; // do not use needle auto parser, using JSON.parse below
|
||||
request.makeRequest(payload, (error, res, body) => {
|
||||
var _a;
|
||||
if (error) {
|
||||
return reject(error);
|
||||
}
|
||||
if (((_a = res === null || res === void 0 ? void 0 : res.headers) === null || _a === void 0 ? void 0 : _a[constants_1.headerSnykAuthFailed]) === 'true') {
|
||||
return reject(new errors_1.MissingApiTokenError());
|
||||
}
|
||||
if (res.statusCode === 400) {
|
||||
return reject({
|
||||
code: res.statusCode,
|
||||
body: JSON.parse(body),
|
||||
});
|
||||
}
|
||||
else if (res.statusCode >= 401) {
|
||||
return reject({
|
||||
code: res.statusCode,
|
||||
});
|
||||
}
|
||||
resolve(JSON.parse(body));
|
||||
});
|
||||
});
|
||||
}
|
||||
exports.makeRequestRest = makeRequestRest;
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
};
|
||||
;
|
||||
//# sourceMappingURL=663.index.js.map
|
||||
1
safekiso-server/node_modules/snyk/dist/cli/663.index.js.map
generated
vendored
Normal file
1
safekiso-server/node_modules/snyk/dist/cli/663.index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
9360
safekiso-server/node_modules/snyk/dist/cli/674.index.js
generated
vendored
Normal file
9360
safekiso-server/node_modules/snyk/dist/cli/674.index.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
safekiso-server/node_modules/snyk/dist/cli/674.index.js.map
generated
vendored
Normal file
1
safekiso-server/node_modules/snyk/dist/cli/674.index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
232
safekiso-server/node_modules/snyk/dist/cli/726.index.js
generated
vendored
Normal file
232
safekiso-server/node_modules/snyk/dist/cli/726.index.js
generated
vendored
Normal file
@@ -0,0 +1,232 @@
|
||||
exports.id = 726;
|
||||
exports.ids = [726];
|
||||
exports.modules = {
|
||||
|
||||
/***/ 94378:
|
||||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||||
|
||||
try {
|
||||
var util = __webpack_require__(73837);
|
||||
/* istanbul ignore next */
|
||||
if (typeof util.inherits !== 'function') throw '';
|
||||
module.exports = util.inherits;
|
||||
} catch (e) {
|
||||
/* istanbul ignore next */
|
||||
module.exports = __webpack_require__(35717);
|
||||
}
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 35717:
|
||||
/***/ ((module) => {
|
||||
|
||||
if (typeof Object.create === 'function') {
|
||||
// implementation from standard node.js 'util' module
|
||||
module.exports = function inherits(ctor, superCtor) {
|
||||
if (superCtor) {
|
||||
ctor.super_ = superCtor
|
||||
ctor.prototype = Object.create(superCtor.prototype, {
|
||||
constructor: {
|
||||
value: ctor,
|
||||
enumerable: false,
|
||||
writable: true,
|
||||
configurable: true
|
||||
}
|
||||
})
|
||||
}
|
||||
};
|
||||
} else {
|
||||
// old school shim for old browsers
|
||||
module.exports = function inherits(ctor, superCtor) {
|
||||
if (superCtor) {
|
||||
ctor.super_ = superCtor
|
||||
var TempCtor = function () {}
|
||||
TempCtor.prototype = superCtor.prototype
|
||||
ctor.prototype = new TempCtor()
|
||||
ctor.prototype.constructor = ctor
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 70919:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.FlagError = void 0;
|
||||
const process_command_args_1 = __webpack_require__(52369);
|
||||
const legacyError = __webpack_require__(79407);
|
||||
const drift_1 = __webpack_require__(26445);
|
||||
const errors_1 = __webpack_require__(55191);
|
||||
const get_iac_org_settings_1 = __webpack_require__(11693);
|
||||
const assert_iac_options_flag_1 = __webpack_require__(33111);
|
||||
const config_1 = __webpack_require__(25425);
|
||||
const analytics_1 = __webpack_require__(41519);
|
||||
const analytics = __webpack_require__(82744);
|
||||
const policy_1 = __webpack_require__(32615);
|
||||
const driftctl_1 = __webpack_require__(3659);
|
||||
const types_1 = __webpack_require__(94820);
|
||||
const error_utils_1 = __webpack_require__(36401);
|
||||
const error_catalog_nodejs_public_1 = __webpack_require__(88404);
|
||||
class FlagError extends errors_1.CustomError {
|
||||
constructor(flag) {
|
||||
const msg = `Unsupported flag "${flag}" provided. Run snyk iac describe --help for supported flags`;
|
||||
super(msg);
|
||||
this.code = types_1.IaCErrorCodes.FlagError;
|
||||
this.strCode = (0, error_utils_1.getErrorStringCode)(this.code);
|
||||
this.userMessage = msg;
|
||||
this.errorCatalog = new error_catalog_nodejs_public_1.CLI.InvalidFlagOptionError('');
|
||||
}
|
||||
}
|
||||
exports.FlagError = FlagError;
|
||||
exports["default"] = async (...args) => {
|
||||
var _a, _b;
|
||||
const { options } = (0, process_command_args_1.processCommandArgs)(...args);
|
||||
// Ensure that this describe command can only be runned when using `snyk iac describe`
|
||||
// Avoid `snyk describe` direct usage
|
||||
if (options.iac != true) {
|
||||
return legacyError('describe');
|
||||
}
|
||||
if (options['only-managed']) {
|
||||
return Promise.reject(new FlagError('only-managed'));
|
||||
}
|
||||
// Ensure that we are allowed to run that command
|
||||
// by checking the entitlement
|
||||
const orgPublicId = (_a = options.org) !== null && _a !== void 0 ? _a : config_1.default.org;
|
||||
const iacOrgSettings = await (0, get_iac_org_settings_1.getIacOrgSettings)(orgPublicId);
|
||||
if (!((_b = iacOrgSettings.entitlements) === null || _b === void 0 ? void 0 : _b.iacDrift)) {
|
||||
throw new assert_iac_options_flag_1.UnsupportedEntitlementCommandError('drift', 'iacDrift');
|
||||
}
|
||||
const policy = await (0, policy_1.findAndLoadPolicy)(process.cwd(), 'iac', options);
|
||||
const driftIgnore = (0, drift_1.driftignoreFromPolicy)(policy);
|
||||
try {
|
||||
const describe = await (0, driftctl_1.runDriftCTL)({
|
||||
options: { ...options, kind: 'describe' },
|
||||
driftIgnore: driftIgnore,
|
||||
});
|
||||
process.exitCode = describe.code;
|
||||
analytics.add('is-iac-drift', true);
|
||||
analytics.add('iac-drift-exit-code', describe.code);
|
||||
if (describe.code === driftctl_1.DCTL_EXIT_CODES.EXIT_ERROR) {
|
||||
throw new Error();
|
||||
}
|
||||
// Parse analysis JSON and add to analytics
|
||||
const analysis = (0, drift_1.parseDriftAnalysisResults)(describe.stdout);
|
||||
(0, analytics_1.addIacDriftAnalytics)(analysis, options);
|
||||
const output = await (0, drift_1.processAnalysis)(options, describe);
|
||||
process.stdout.write(output);
|
||||
}
|
||||
catch (e) {
|
||||
return Promise.reject(e);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 8820:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.findAndLoadPolicy = void 0;
|
||||
const snykPolicyLib = __webpack_require__(13284);
|
||||
const debugModule = __webpack_require__(15158);
|
||||
const _1 = __webpack_require__(32615);
|
||||
const analytics = __webpack_require__(82744);
|
||||
const debug = debugModule('snyk');
|
||||
async function findAndLoadPolicy(root, scanType, options, pkg, scannedProjectFolder) {
|
||||
const isDocker = scanType === 'docker';
|
||||
const isNodeProject = ['npm', 'yarn', 'pnpm'].includes(scanType);
|
||||
// monitor
|
||||
let policyLocations = [
|
||||
options['policy-path'] || scannedProjectFolder || root,
|
||||
];
|
||||
if (isDocker) {
|
||||
policyLocations = policyLocations.filter((loc) => loc !== root);
|
||||
}
|
||||
else if (isNodeProject) {
|
||||
// TODO: pluckPolicies expects a package.json object to
|
||||
// find and apply policies in node_modules
|
||||
// TODO: fix these types, this is a hack and is not correct
|
||||
policyLocations = policyLocations.concat((0, _1.pluckPolicies)(pkg));
|
||||
}
|
||||
debug('Potential policy locations found:', policyLocations);
|
||||
analytics.add('policies', policyLocations.length);
|
||||
analytics.add('policyLocations', policyLocations);
|
||||
if (policyLocations.length === 0) {
|
||||
return;
|
||||
}
|
||||
let policy;
|
||||
try {
|
||||
policy = await snykPolicyLib.load(policyLocations, options);
|
||||
}
|
||||
catch (err) {
|
||||
// note: inline catch, to handle error from .load
|
||||
// if the .snyk file wasn't found, it is fine
|
||||
if (err.code !== 'ENOENT' && err.code !== 'ENOTDIR') {
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
return policy;
|
||||
}
|
||||
exports.findAndLoadPolicy = findAndLoadPolicy;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 32615:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.findAndLoadPolicy = exports.pluckPolicies = void 0;
|
||||
var pluck_policies_1 = __webpack_require__(68247);
|
||||
Object.defineProperty(exports, "pluckPolicies", ({ enumerable: true, get: function () { return pluck_policies_1.pluckPolicies; } }));
|
||||
var find_and_load_policy_1 = __webpack_require__(8820);
|
||||
Object.defineProperty(exports, "findAndLoadPolicy", ({ enumerable: true, get: function () { return find_and_load_policy_1.findAndLoadPolicy; } }));
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 68247:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.pluckPolicies = void 0;
|
||||
const flatten = __webpack_require__(5800);
|
||||
function pluckPolicies(pkg) {
|
||||
if (!pkg) {
|
||||
return [];
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore: broken type
|
||||
if (pkg.snyk) {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore: broken type
|
||||
return pkg.snyk;
|
||||
}
|
||||
if (!pkg.dependencies) {
|
||||
return [];
|
||||
}
|
||||
return flatten(Object.keys(pkg.dependencies)
|
||||
.map((name) => pluckPolicies(pkg.dependencies[name]))
|
||||
.filter(Boolean));
|
||||
}
|
||||
exports.pluckPolicies = pluckPolicies;
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
};
|
||||
;
|
||||
//# sourceMappingURL=726.index.js.map
|
||||
1
safekiso-server/node_modules/snyk/dist/cli/726.index.js.map
generated
vendored
Normal file
1
safekiso-server/node_modules/snyk/dist/cli/726.index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
2786
safekiso-server/node_modules/snyk/dist/cli/741.index.js
generated
vendored
Normal file
2786
safekiso-server/node_modules/snyk/dist/cli/741.index.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
safekiso-server/node_modules/snyk/dist/cli/741.index.js.map
generated
vendored
Normal file
1
safekiso-server/node_modules/snyk/dist/cli/741.index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
9767
safekiso-server/node_modules/snyk/dist/cli/790.index.js
generated
vendored
Normal file
9767
safekiso-server/node_modules/snyk/dist/cli/790.index.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
safekiso-server/node_modules/snyk/dist/cli/790.index.js.map
generated
vendored
Normal file
1
safekiso-server/node_modules/snyk/dist/cli/790.index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
safekiso-server/node_modules/snyk/dist/cli/7f89dbdfc33cb8f20621ac96fb48ecd0.node
generated
vendored
Normal file
BIN
safekiso-server/node_modules/snyk/dist/cli/7f89dbdfc33cb8f20621ac96fb48ecd0.node
generated
vendored
Normal file
Binary file not shown.
69
safekiso-server/node_modules/snyk/dist/cli/831.index.js
generated
vendored
Normal file
69
safekiso-server/node_modules/snyk/dist/cli/831.index.js
generated
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
"use strict";
|
||||
exports.id = 831;
|
||||
exports.ids = [831];
|
||||
exports.modules = {
|
||||
|
||||
/***/ 87831:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
const process_command_args_1 = __webpack_require__(52369);
|
||||
const legacyError = __webpack_require__(79407);
|
||||
const fs = __webpack_require__(57147);
|
||||
const snykPolicyLib = __webpack_require__(13284);
|
||||
const get_iac_org_settings_1 = __webpack_require__(11693);
|
||||
const assert_iac_options_flag_1 = __webpack_require__(33111);
|
||||
const config_1 = __webpack_require__(25425);
|
||||
const drift_1 = __webpack_require__(26445);
|
||||
const analytics = __webpack_require__(82744);
|
||||
exports["default"] = async (...args) => {
|
||||
var _a, _b;
|
||||
const { options } = (0, process_command_args_1.processCommandArgs)(...args);
|
||||
// Ensure that this update-exclude-policy command can only be runned when using `snyk iac update-exclude-policy`
|
||||
// Avoid `snyk update-exclude-policy` direct usage
|
||||
if (options.iac != true) {
|
||||
return legacyError('update-exclude-policy');
|
||||
}
|
||||
// Ensure that we are allowed to run that command
|
||||
// by checking the entitlement
|
||||
const orgPublicId = (_a = options.org) !== null && _a !== void 0 ? _a : config_1.default.org;
|
||||
const iacOrgSettings = await (0, get_iac_org_settings_1.getIacOrgSettings)(orgPublicId);
|
||||
if (!((_b = iacOrgSettings.entitlements) === null || _b === void 0 ? void 0 : _b.iacDrift)) {
|
||||
throw new assert_iac_options_flag_1.UnsupportedEntitlementCommandError('update-exclude-policy', 'iacDrift');
|
||||
}
|
||||
try {
|
||||
// There's an open bug for this in Windows in the current version of node when called with no stdinput.
|
||||
// See https://github.com/nodejs/node/issues/19831
|
||||
// The actual error handling behavior is enough for now but may be improved if needed
|
||||
const analysis = (0, drift_1.parseDriftAnalysisResults)(fs.readFileSync(0).toString());
|
||||
// Add analytics
|
||||
analytics.add('is-iac-drift', true);
|
||||
let policy;
|
||||
try {
|
||||
policy = await snykPolicyLib.load();
|
||||
}
|
||||
catch (error) {
|
||||
if (error.code === 'ENOENT') {
|
||||
// policy file does not exist - create it
|
||||
policy = await snykPolicyLib.create();
|
||||
}
|
||||
else {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
await (0, drift_1.updateExcludeInPolicy)(policy, analysis, options);
|
||||
await snykPolicyLib.save(policy);
|
||||
}
|
||||
catch (e) {
|
||||
const err = new Error('Error running `iac update-exclude-policy` ' + e);
|
||||
return Promise.reject(err);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
};
|
||||
;
|
||||
//# sourceMappingURL=831.index.js.map
|
||||
1
safekiso-server/node_modules/snyk/dist/cli/831.index.js.map
generated
vendored
Normal file
1
safekiso-server/node_modules/snyk/dist/cli/831.index.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"831.index.js","mappings":";;;;;;;;;;AACA,0DAA4D;AAC5D,+CAA8D;AAC9D,sCAAyB;AACzB,iDAA6C;AAC7C,0DAAiG;AACjG,6DAAwG;AACxG,4CAAsC;AACtC,2CAG6B;AAC7B,6CAAiD;AAEjD,qBAAe,KAAK,EAAE,GAAG,IAAgB,EAAgB,EAAE;;IACzD,MAAM,EAAE,OAAO,EAAE,GAAG,6CAAkB,EAAC,GAAG,IAAI,CAAC,CAAC;IAEhD,gHAAgH;IAChH,kDAAkD;IAClD,IAAI,OAAO,CAAC,GAAG,IAAI,IAAI,EAAE;QACvB,OAAO,WAAW,CAAC,uBAAuB,CAAC,CAAC;KAC7C;IAED,iDAAiD;IACjD,8BAA8B;IAC9B,MAAM,WAAW,GAAG,aAAO,CAAC,GAAG,mCAAI,gBAAM,CAAC,GAAG,CAAC;IAC9C,MAAM,cAAc,GAAG,MAAM,4CAAiB,EAAC,WAAW,CAAC,CAAC;IAC5D,IAAI,CAAC,qBAAc,CAAC,YAAY,0CAAE,QAAQ,GAAE;QAC1C,MAAM,IAAI,4DAAkC,CAC1C,uBAAuB,EACvB,UAAU,CACX,CAAC;KACH;IAED,IAAI;QACF,uGAAuG;QACvG,kDAAkD;QAClD,qFAAqF;QACrF,MAAM,QAAQ,GAAG,qCAAyB,EAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;QAE1E,gBAAgB;QAChB,SAAS,CAAC,GAAG,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;QAEpC,IAAI,MAA4B,CAAC;QACjC,IAAI;YACF,MAAM,GAAG,MAAM,aAAa,CAAC,IAAI,EAAE,CAAC;SACrC;QAAC,OAAO,KAAK,EAAE;YACd,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE;gBAC3B,yCAAyC;gBACzC,MAAM,GAAG,MAAM,aAAa,CAAC,MAAM,EAAE,CAAC;aACvC;iBAAM;gBACL,MAAM,KAAK,CAAC;aACb;SACF;QACD,MAAM,iCAAqB,EAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;QACvD,MAAM,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;KAClC;IAAC,OAAO,CAAC,EAAE;QACV,MAAM,GAAG,GAAG,IAAI,KAAK,CAAC,4CAA4C,GAAG,CAAC,CAAC,CAAC;QACxE,OAAO,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;KAC5B;AACH,CAAC,CAAC","sources":["webpack://snyk/./src/cli/commands/update-exclude-policy.ts"],"sourcesContent":["import { MethodArgs } from '../args';\nimport { processCommandArgs } from './process-command-args';\nimport * as legacyError from '../../lib/errors/legacy-errors';\nimport * as fs from 'fs';\nimport * as snykPolicyLib from 'snyk-policy';\nimport { getIacOrgSettings } from './test/iac/local-execution/org-settings/get-iac-org-settings';\nimport { UnsupportedEntitlementCommandError } from './test/iac/local-execution/assert-iac-options-flag';\nimport config from '../../lib/config';\nimport {\n parseDriftAnalysisResults,\n updateExcludeInPolicy,\n} from '../../lib/iac/drift';\nimport * as analytics from '../../lib/analytics';\n\nexport default async (...args: MethodArgs): Promise<any> => {\n const { options } = processCommandArgs(...args);\n\n // Ensure that this update-exclude-policy command can only be runned when using `snyk iac update-exclude-policy`\n // Avoid `snyk update-exclude-policy` direct usage\n if (options.iac != true) {\n return legacyError('update-exclude-policy');\n }\n\n // Ensure that we are allowed to run that command\n // by checking the entitlement\n const orgPublicId = options.org ?? config.org;\n const iacOrgSettings = await getIacOrgSettings(orgPublicId);\n if (!iacOrgSettings.entitlements?.iacDrift) {\n throw new UnsupportedEntitlementCommandError(\n 'update-exclude-policy',\n 'iacDrift',\n );\n }\n\n try {\n // There's an open bug for this in Windows in the current version of node when called with no stdinput.\n // See https://github.com/nodejs/node/issues/19831\n // The actual error handling behavior is enough for now but may be improved if needed\n const analysis = parseDriftAnalysisResults(fs.readFileSync(0).toString());\n\n // Add analytics\n analytics.add('is-iac-drift', true);\n\n let policy: snykPolicyLib.Policy;\n try {\n policy = await snykPolicyLib.load();\n } catch (error) {\n if (error.code === 'ENOENT') {\n // policy file does not exist - create it\n policy = await snykPolicyLib.create();\n } else {\n throw error;\n }\n }\n await updateExcludeInPolicy(policy, analysis, options);\n await snykPolicyLib.save(policy);\n } catch (e) {\n const err = new Error('Error running `iac update-exclude-policy` ' + e);\n return Promise.reject(err);\n }\n};\n"],"names":[],"sourceRoot":""}
|
||||
315
safekiso-server/node_modules/snyk/dist/cli/85.index.js
generated
vendored
Normal file
315
safekiso-server/node_modules/snyk/dist/cli/85.index.js
generated
vendored
Normal file
@@ -0,0 +1,315 @@
|
||||
"use strict";
|
||||
exports.id = 85;
|
||||
exports.ids = [85];
|
||||
exports.modules = {
|
||||
|
||||
/***/ 21085:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.findHelpFile = void 0;
|
||||
const fs = __webpack_require__(57147);
|
||||
const path = __webpack_require__(71017);
|
||||
const markdown_renderer_1 = __webpack_require__(99387);
|
||||
function findHelpFile(helpArgs, helpFolderPath = '../../help/cli-commands') {
|
||||
while (helpArgs.length > 0) {
|
||||
// cleanse the filename to only contain letters
|
||||
// aka: /\W/g but figured this was easier to read
|
||||
const file = `${helpArgs.join('-').replace(/[^a-z0-9-]/gi, '')}.md`;
|
||||
const testHelpAbsolutePath = path.resolve(__dirname, helpFolderPath, file);
|
||||
if (fs.existsSync(testHelpAbsolutePath)) {
|
||||
return testHelpAbsolutePath;
|
||||
}
|
||||
helpArgs = helpArgs.slice(0, -1);
|
||||
}
|
||||
return path.resolve(__dirname, helpFolderPath, `README.md`); // Default help file
|
||||
}
|
||||
exports.findHelpFile = findHelpFile;
|
||||
async function help(...args) {
|
||||
const helpArgs = args.filter((arg) => typeof arg === 'string');
|
||||
const helpFileAbsolutePath = findHelpFile(helpArgs);
|
||||
return (0, markdown_renderer_1.renderMarkdown)(fs.readFileSync(helpFileAbsolutePath, 'utf8'));
|
||||
}
|
||||
exports["default"] = help;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 99387:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.renderMarkdown = void 0;
|
||||
const marked_1 = __webpack_require__(30970);
|
||||
const chalk_1 = __webpack_require__(32589);
|
||||
const reflow_text_1 = __webpack_require__(67211);
|
||||
// stateful variable to control left-padding by header level
|
||||
let currentHeader = 1;
|
||||
const listItemSeparator = 'LISTITEMSEPARATOR'; // Helper string for rendering ListItems
|
||||
/**
|
||||
* @description get padding spaces depending on the last header level used
|
||||
* @returns string
|
||||
*/
|
||||
function getLeftTextPadding() {
|
||||
return ' '.repeat(currentHeader === 1 || currentHeader === 2 ? 1 : currentHeader - 1);
|
||||
}
|
||||
/**
|
||||
* @description Reads current terminal width if available to limit column width for text-reflowing
|
||||
* @returns {number}
|
||||
*/
|
||||
const defaultMaximumLineWidth = 100;
|
||||
function getIdealTextWidth(maximumLineWidth = defaultMaximumLineWidth) {
|
||||
if (typeof process.stdout.columns === 'number') {
|
||||
if (process.stdout.columns < maximumLineWidth) {
|
||||
return process.stdout.columns - getLeftTextPadding().length - 5;
|
||||
}
|
||||
}
|
||||
return maximumLineWidth - getLeftTextPadding().length;
|
||||
}
|
||||
// Marked custom renderer class
|
||||
const renderer = {
|
||||
em(text) {
|
||||
return chalk_1.default.italic(text);
|
||||
},
|
||||
strong(text) {
|
||||
return chalk_1.default.bold(text);
|
||||
},
|
||||
link(href, title, text) {
|
||||
// Don't render links to relative paths (like local files)
|
||||
if (href.startsWith('./') || !href.includes('://')) {
|
||||
return text;
|
||||
}
|
||||
const renderedLink = chalk_1.default.bold.blueBright(href);
|
||||
if (text && text !== href) {
|
||||
return `${text} ${renderedLink}`;
|
||||
}
|
||||
return renderedLink;
|
||||
},
|
||||
blockquote(quote) {
|
||||
return quote;
|
||||
},
|
||||
list(body, ordered, start) {
|
||||
return (body
|
||||
.split(listItemSeparator)
|
||||
.map((listItem, listItemIndex) => {
|
||||
const bulletPoint = ordered ? `${listItemIndex + start}. ` : '- ';
|
||||
return (0, reflow_text_1.reflowText)(listItem, getIdealTextWidth())
|
||||
.split('\n')
|
||||
.map((listItemLine, listItemLineIndex) => {
|
||||
if (!listItemLine) {
|
||||
return '';
|
||||
}
|
||||
return `${getLeftTextPadding()}${listItemLineIndex === 0 ? bulletPoint : ' '}${listItemLine}`;
|
||||
})
|
||||
.join('\n');
|
||||
})
|
||||
.join('\n') + '\n');
|
||||
},
|
||||
listitem(text) {
|
||||
return text + listItemSeparator;
|
||||
},
|
||||
paragraph(text) {
|
||||
return ((0, reflow_text_1.reflowText)(text, getIdealTextWidth())
|
||||
.split('\n')
|
||||
.map((s) => getLeftTextPadding() + chalk_1.default.reset() + s)
|
||||
.join('\n') + '\n\n');
|
||||
},
|
||||
codespan(text) {
|
||||
return chalk_1.default.italic.blueBright(`${text}`);
|
||||
},
|
||||
code(code) {
|
||||
return (code
|
||||
.split('\n')
|
||||
.map((s) => getLeftTextPadding() + chalk_1.default.reset() + s)
|
||||
.join('\n') + '\n\n');
|
||||
},
|
||||
heading(text, level) {
|
||||
currentHeader = level;
|
||||
let coloring;
|
||||
switch (level) {
|
||||
case 1:
|
||||
coloring = chalk_1.default.bold.underline;
|
||||
break;
|
||||
case 3:
|
||||
case 4:
|
||||
coloring = chalk_1.default;
|
||||
break;
|
||||
default:
|
||||
coloring = chalk_1.default.bold;
|
||||
break;
|
||||
}
|
||||
return `${' '.repeat(level === 1 ? 0 : currentHeader - 2)}${coloring(text)}\n`;
|
||||
},
|
||||
};
|
||||
marked_1.marked.use({ renderer });
|
||||
marked_1.marked.setOptions({
|
||||
mangle: false,
|
||||
});
|
||||
const htmlUnescapes = {
|
||||
'&': '&',
|
||||
'<': '<',
|
||||
'>': '>',
|
||||
'"': '"',
|
||||
''': "'",
|
||||
'`': '`',
|
||||
' ': '',
|
||||
};
|
||||
/**
|
||||
* @description Replace HTML entities with their non-encoded variant
|
||||
* @param {string} text
|
||||
* @returns {string}
|
||||
*/
|
||||
function unescape(text) {
|
||||
Object.entries(htmlUnescapes).forEach(([escapedChar, unescapedChar]) => {
|
||||
const escapedCharRegExp = new RegExp(escapedChar, 'g');
|
||||
text = text.replace(escapedCharRegExp, unescapedChar);
|
||||
});
|
||||
return text;
|
||||
}
|
||||
function renderMarkdown(markdown) {
|
||||
return unescape(marked_1.marked.parse(markdown));
|
||||
}
|
||||
exports.renderMarkdown = renderMarkdown;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 67211:
|
||||
/***/ ((__unused_webpack_module, exports) => {
|
||||
|
||||
|
||||
/**
|
||||
Code in this file is adapted from mikaelbr/marked-terminal
|
||||
https://github.com/mikaelbr/marked-terminal/blob/7501b8bb24a5ed52ec7d9114d4aeefa14f1bf5e6/index.js#L234-L330
|
||||
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2017 Mikael Brevik
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.reflowText = void 0;
|
||||
// Compute length of str not including ANSI escape codes.
|
||||
// See http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
|
||||
function textLength(str) {
|
||||
// eslint-disable-next-line no-control-regex
|
||||
return str.replace(/\u001b\[(?:\d{1,3})(?:;\d{1,3})*m/g, '').length;
|
||||
}
|
||||
// Munge \n's and spaces in "text" so that the number of
|
||||
// characters between \n's is less than or equal to "width".
|
||||
function reflowText(text, width) {
|
||||
const HARD_RETURN = '\r|\n';
|
||||
const HARD_RETURN_GFM_RE = new RegExp(HARD_RETURN + '|<br ?/?>');
|
||||
const splitRe = HARD_RETURN_GFM_RE;
|
||||
const sections = text.split(splitRe);
|
||||
const reflowed = [];
|
||||
sections.forEach((section) => {
|
||||
// Split the section by escape codes so that we can
|
||||
// deal with them separately.
|
||||
// eslint-disable-next-line no-control-regex
|
||||
const fragments = section.split(/(\u001b\[(?:\d{1,3})(?:;\d{1,3})*m)/g);
|
||||
let column = 0;
|
||||
let currentLine = '';
|
||||
let lastWasEscapeChar = false;
|
||||
while (fragments.length) {
|
||||
const fragment = fragments[0];
|
||||
if (fragment === '') {
|
||||
fragments.splice(0, 1);
|
||||
lastWasEscapeChar = false;
|
||||
continue;
|
||||
}
|
||||
// This is an escape code - leave it whole and
|
||||
// move to the next fragment.
|
||||
if (!textLength(fragment)) {
|
||||
currentLine += fragment;
|
||||
fragments.splice(0, 1);
|
||||
lastWasEscapeChar = true;
|
||||
continue;
|
||||
}
|
||||
const words = fragment.split(/[ \t\n]+/);
|
||||
for (let i = 0; i < words.length; i++) {
|
||||
let word = words[i];
|
||||
let addSpace = column != 0;
|
||||
if (lastWasEscapeChar)
|
||||
addSpace = false;
|
||||
// If adding the new word overflows the required width
|
||||
if (column + word.length > width) {
|
||||
if (word.length <= width) {
|
||||
// If the new word is smaller than the required width
|
||||
// just add it at the beginning of a new line
|
||||
reflowed.push(currentLine);
|
||||
currentLine = word;
|
||||
column = word.length;
|
||||
}
|
||||
else {
|
||||
// If the new word is longer than the required width
|
||||
// split this word into smaller parts.
|
||||
const w = word.substr(0, width - column);
|
||||
if (addSpace)
|
||||
currentLine += ' ';
|
||||
currentLine += w;
|
||||
reflowed.push(currentLine);
|
||||
currentLine = '';
|
||||
column = 0;
|
||||
word = word.substr(w.length);
|
||||
while (word.length) {
|
||||
const w = word.substr(0, width);
|
||||
if (!w.length)
|
||||
break;
|
||||
if (w.length < width) {
|
||||
currentLine = w;
|
||||
column = w.length;
|
||||
break;
|
||||
}
|
||||
else {
|
||||
reflowed.push(w);
|
||||
word = word.substr(width);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (addSpace) {
|
||||
currentLine += ' ';
|
||||
column++;
|
||||
}
|
||||
currentLine += word;
|
||||
column += word.length;
|
||||
}
|
||||
lastWasEscapeChar = false;
|
||||
}
|
||||
fragments.splice(0, 1);
|
||||
}
|
||||
if (textLength(currentLine))
|
||||
reflowed.push(currentLine);
|
||||
});
|
||||
return reflowed.join('\n');
|
||||
}
|
||||
exports.reflowText = reflowText;
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
};
|
||||
;
|
||||
//# sourceMappingURL=85.index.js.map
|
||||
1
safekiso-server/node_modules/snyk/dist/cli/85.index.js.map
generated
vendored
Normal file
1
safekiso-server/node_modules/snyk/dist/cli/85.index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
109
safekiso-server/node_modules/snyk/dist/cli/855.index.js
generated
vendored
Normal file
109
safekiso-server/node_modules/snyk/dist/cli/855.index.js
generated
vendored
Normal file
@@ -0,0 +1,109 @@
|
||||
"use strict";
|
||||
exports.id = 855;
|
||||
exports.ids = [855];
|
||||
exports.modules = {
|
||||
|
||||
/***/ 66855:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
const getWoof_1 = __webpack_require__(76993);
|
||||
function woof(...args) {
|
||||
const woof = (0, getWoof_1.default)(args);
|
||||
console.log(`
|
||||
| |
|
||||
/| |\\
|
||||
| | | |
|
||||
| |/-------\\| |
|
||||
\\ /
|
||||
| \\ / |
|
||||
| \\o/ \\o/ |
|
||||
| | | |
|
||||
\\/ | | \\/
|
||||
| | | |
|
||||
\\ ( ) /
|
||||
\\_/ \\_/ /-----\\
|
||||
\\U/ --( ${woof} )
|
||||
\\-----/
|
||||
`);
|
||||
}
|
||||
exports["default"] = woof;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 76993:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
const preview_features_enabled_1 = __webpack_require__(76278);
|
||||
const woofs = {
|
||||
en: 'Woof!',
|
||||
he: ' בה! ',
|
||||
ru: ' Гав!',
|
||||
es: 'Guau!',
|
||||
cs: ' Haf!',
|
||||
uk: ' Гав!',
|
||||
de: 'Wuff!',
|
||||
ro: ' Ham!',
|
||||
cat: 'Meow?',
|
||||
};
|
||||
function getWoof(args) {
|
||||
const options = args.pop();
|
||||
let lang = 'en';
|
||||
if (typeof options.language === 'string' &&
|
||||
Object.keys(woofs).includes(options.language)) {
|
||||
lang = options.language;
|
||||
}
|
||||
if (lang === 'cat') {
|
||||
for (const option in options) {
|
||||
console.debug(`${option}:::`, options[option], `:::${option}`);
|
||||
}
|
||||
const envVal = options.env;
|
||||
if (envVal) {
|
||||
console.debug(envVal + '=' + process.env[envVal]);
|
||||
}
|
||||
if ((0, preview_features_enabled_1.previewFeaturesEnabled)()) {
|
||||
console.debug('This is a previewoof!');
|
||||
}
|
||||
if (options['exit-code'] != undefined) {
|
||||
const exitCode = Number(options['exit-code']);
|
||||
if (exitCode < 0) {
|
||||
process.abort();
|
||||
}
|
||||
else {
|
||||
process.exit(exitCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
return woofs[lang];
|
||||
}
|
||||
exports["default"] = getWoof;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 76278:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.previewFeaturesEnabled = void 0;
|
||||
const debug = __webpack_require__(15158)('preview');
|
||||
function previewFeaturesEnabled() {
|
||||
if (process.env.SNYK_INTERNAL_PREVIEW_FEATURES === '1') {
|
||||
debug('Using a preview feature!');
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
exports.previewFeaturesEnabled = previewFeaturesEnabled;
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
};
|
||||
;
|
||||
//# sourceMappingURL=855.index.js.map
|
||||
1
safekiso-server/node_modules/snyk/dist/cli/855.index.js.map
generated
vendored
Normal file
1
safekiso-server/node_modules/snyk/dist/cli/855.index.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"855.index.js","mappings":";;;;;;;;;;AACA,6CAAqC;AAErC,SAAwB,IAAI,CAAC,GAAG,IAAgB;IAC9C,MAAM,IAAI,GAAG,qBAAO,EAAC,IAAI,CAAC,CAAC;IAC3B,OAAO,CAAC,GAAG,CAAC;;;;;;;;;;;;;mBAaK,IAAI;;CAEtB,CAAC,CAAC;AACH,CAAC;AAlBD,0BAkBC;;;;;;;;;;ACpBD,8DAA+E;AAE/E,MAAM,KAAK,GAAG;IACZ,EAAE,EAAE,OAAO;IACX,EAAE,EAAE,OAAO;IACX,EAAE,EAAE,OAAO;IACX,EAAE,EAAE,OAAO;IACX,EAAE,EAAE,OAAO;IACX,EAAE,EAAE,OAAO;IACX,EAAE,EAAE,OAAO;IACX,EAAE,EAAE,OAAO;IACX,GAAG,EAAE,OAAO;CACb,CAAC;AAEF,SAAwB,OAAO,CAAC,IAAgB;IAC9C,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,EAAiB,CAAC;IAC1C,IAAI,IAAI,GAAG,IAAI,CAAC;IAEhB,IACE,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ;QACpC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,EAC7C;QACA,IAAI,GAAG,OAAO,CAAC,QAAQ,CAAC;KACzB;IAED,IAAI,IAAI,KAAK,KAAK,EAAE;QAClB,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;YAC5B,OAAO,CAAC,KAAK,CAAC,GAAG,MAAM,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,MAAM,EAAE,CAAC,CAAC;SAChE;QAED,MAAM,MAAM,GAAG,OAAO,CAAC,GAAa,CAAC;QACrC,IAAI,MAAM,EAAE;YACV,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;SACnD;QAED,IAAI,qDAAsB,GAAE,EAAE;YAC5B,OAAO,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC;SACxC;QAED,IAAI,OAAO,CAAC,WAAW,CAAC,IAAI,SAAS,EAAE;YACrC,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC;YAC9C,IAAI,QAAQ,GAAG,CAAC,EAAE;gBAChB,OAAO,CAAC,KAAK,EAAE,CAAC;aACjB;iBAAM;gBACL,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;aACxB;SACF;KACF;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC;AACrB,CAAC;AApCD,6BAoCC;;;;;;;;;;;ACnDD,MAAM,KAAK,GAAG,mBAAO,CAAC,KAAO,CAAC,CAAC,SAAS,CAAC,CAAC;AAE1C,SAAgB,sBAAsB;IACpC,IAAI,OAAO,CAAC,GAAG,CAAC,8BAA8B,KAAK,GAAG,EAAE;QACtD,KAAK,CAAC,0BAA0B,CAAC,CAAC;QAClC,OAAO,IAAI,CAAC;KACb;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAND,wDAMC","sources":["webpack://snyk/./src/cli/commands/woof.ts","webpack://snyk/./src/cli/commands/woof/getWoof.ts","webpack://snyk/./src/lib/preview-features-enabled.ts"],"sourcesContent":["import { MethodArgs } from '../args';\nimport getWoof from './woof/getWoof';\n\nexport default function woof(...args: MethodArgs): void {\n const woof = getWoof(args);\n console.log(`\n | |\n /| |\\\\\n | | | |\n | |/-------\\\\| |\n \\\\ /\n | \\\\ / |\n | \\\\o/ \\\\o/ |\n | | | |\n \\\\/ | | \\\\/\n | | | |\n \\\\ ( ) /\n \\\\_/ \\\\_/ /-----\\\\\n \\\\U/ --( ${woof} )\n \\\\-----/\n`);\n}\n","import { MethodArgs, ArgsOptions } from '../../args';\nimport { previewFeaturesEnabled } from '../../../lib/preview-features-enabled';\n\nconst woofs = {\n en: 'Woof!',\n he: ' בה! ',\n ru: ' Гав!',\n es: 'Guau!',\n cs: ' Haf!',\n uk: ' Гав!',\n de: 'Wuff!',\n ro: ' Ham!',\n cat: 'Meow?',\n};\n\nexport default function getWoof(args: MethodArgs): string {\n const options = args.pop() as ArgsOptions;\n let lang = 'en';\n\n if (\n typeof options.language === 'string' &&\n Object.keys(woofs).includes(options.language)\n ) {\n lang = options.language;\n }\n\n if (lang === 'cat') {\n for (const option in options) {\n console.debug(`${option}:::`, options[option], `:::${option}`);\n }\n\n const envVal = options.env as string;\n if (envVal) {\n console.debug(envVal + '=' + process.env[envVal]);\n }\n\n if (previewFeaturesEnabled()) {\n console.debug('This is a previewoof!');\n }\n\n if (options['exit-code'] != undefined) {\n const exitCode = Number(options['exit-code']);\n if (exitCode < 0) {\n process.abort();\n } else {\n process.exit(exitCode);\n }\n }\n }\n\n return woofs[lang];\n}\n","const debug = require('debug')('preview');\n\nexport function previewFeaturesEnabled(): boolean {\n if (process.env.SNYK_INTERNAL_PREVIEW_FEATURES === '1') {\n debug('Using a preview feature!');\n return true;\n }\n return false;\n}\n"],"names":[],"sourceRoot":""}
|
||||
26
safekiso-server/node_modules/snyk/dist/cli/875.index.js
generated
vendored
Normal file
26
safekiso-server/node_modules/snyk/dist/cli/875.index.js
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
"use strict";
|
||||
exports.id = 875;
|
||||
exports.ids = [875];
|
||||
exports.modules = {
|
||||
|
||||
/***/ 74970:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
const version_1 = __webpack_require__(38217);
|
||||
async function version() {
|
||||
let version = (0, version_1.getVersion)();
|
||||
if ((0, version_1.isStandaloneBuild)()) {
|
||||
version += ' (standalone)';
|
||||
}
|
||||
return version;
|
||||
}
|
||||
exports["default"] = version;
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
};
|
||||
;
|
||||
//# sourceMappingURL=875.index.js.map
|
||||
1
safekiso-server/node_modules/snyk/dist/cli/875.index.js.map
generated
vendored
Normal file
1
safekiso-server/node_modules/snyk/dist/cli/875.index.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"875.index.js","mappings":";;;;;;;;;;AAAA,6CAAkE;AAEnD,KAAK,UAAU,OAAO;IACnC,IAAI,OAAO,GAAG,wBAAU,GAAE,CAAC;IAC3B,IAAI,+BAAiB,GAAE,EAAE;QACvB,OAAO,IAAI,eAAe,CAAC;KAC5B;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAND,6BAMC","sources":["webpack://snyk/./src/cli/commands/version.ts"],"sourcesContent":["import { getVersion, isStandaloneBuild } from '../../lib/version';\n\nexport default async function version() {\n let version = getVersion();\n if (isStandaloneBuild()) {\n version += ' (standalone)';\n }\n return version;\n}\n"],"names":[],"sourceRoot":""}
|
||||
7485
safekiso-server/node_modules/snyk/dist/cli/905.index.js
generated
vendored
Normal file
7485
safekiso-server/node_modules/snyk/dist/cli/905.index.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
safekiso-server/node_modules/snyk/dist/cli/905.index.js.map
generated
vendored
Normal file
1
safekiso-server/node_modules/snyk/dist/cli/905.index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
6566
safekiso-server/node_modules/snyk/dist/cli/917.index.js
generated
vendored
Normal file
6566
safekiso-server/node_modules/snyk/dist/cli/917.index.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
safekiso-server/node_modules/snyk/dist/cli/917.index.js.map
generated
vendored
Normal file
1
safekiso-server/node_modules/snyk/dist/cli/917.index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
22
safekiso-server/node_modules/snyk/dist/cli/959.index.js
generated
vendored
Normal file
22
safekiso-server/node_modules/snyk/dist/cli/959.index.js
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
"use strict";
|
||||
exports.id = 959;
|
||||
exports.ids = [959];
|
||||
exports.modules = {
|
||||
|
||||
/***/ 55959:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
const theme = __webpack_require__(86988);
|
||||
function wizard() {
|
||||
console.log(theme.color.status.warn(`\n${theme.icon.WARNING} WARNING: Snyk wizard was removed at 31 March 2022.\nPlease use 'snyk ignore' instead: https://updates.snyk.io/snyk-wizard-and-snyk-protect-removal-224137 \n`));
|
||||
}
|
||||
exports["default"] = wizard;
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
};
|
||||
;
|
||||
//# sourceMappingURL=959.index.js.map
|
||||
1
safekiso-server/node_modules/snyk/dist/cli/959.index.js.map
generated
vendored
Normal file
1
safekiso-server/node_modules/snyk/dist/cli/959.index.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"959.index.js","mappings":";;;;;;;;;;AAAA,yCAA4C;AAE5C,SAAwB,MAAM;IAC5B,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CACrB,KAAK,KAAK,CAAC,IAAI,CAAC,OAAO,+JAA+J,CACvL,CACF,CAAC;AACJ,CAAC;AAND,4BAMC","sources":["webpack://snyk/./src/cli/commands/protect/wizard.ts"],"sourcesContent":["import * as theme from '../../../lib/theme';\n\nexport default function wizard() {\n console.log(\n theme.color.status.warn(\n `\\n${theme.icon.WARNING} WARNING: Snyk wizard was removed at 31 March 2022.\\nPlease use 'snyk ignore' instead: https://updates.snyk.io/snyk-wizard-and-snyk-protect-removal-224137 \\n`,\n ),\n );\n}\n"],"names":[],"sourceRoot":""}
|
||||
2926
safekiso-server/node_modules/snyk/dist/cli/970.index.js
generated
vendored
Normal file
2926
safekiso-server/node_modules/snyk/dist/cli/970.index.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
safekiso-server/node_modules/snyk/dist/cli/970.index.js.map
generated
vendored
Normal file
1
safekiso-server/node_modules/snyk/dist/cli/970.index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
771
safekiso-server/node_modules/snyk/dist/cli/974.index.js
generated
vendored
Normal file
771
safekiso-server/node_modules/snyk/dist/cli/974.index.js
generated
vendored
Normal file
@@ -0,0 +1,771 @@
|
||||
exports.id = 974;
|
||||
exports.ids = [974];
|
||||
exports.modules = {
|
||||
|
||||
/***/ 62148:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
|
||||
var readline = __webpack_require__(14521);
|
||||
|
||||
var defaultSpinnerString = 0;
|
||||
var defaultSpinnerDelay = 60;
|
||||
|
||||
function defaultOnTick(msg) {
|
||||
this.clearLine(this.stream);
|
||||
this.stream.write(msg);
|
||||
};
|
||||
|
||||
var Spinner = function(options){
|
||||
if(!(this instanceof Spinner)) return new Spinner(options)
|
||||
|
||||
if(typeof options === "string"){
|
||||
options = { text: options };
|
||||
} else if(!options){
|
||||
options = {};
|
||||
}
|
||||
|
||||
this.text = options.text || '';
|
||||
this.setSpinnerString(defaultSpinnerString);
|
||||
this.setSpinnerDelay(defaultSpinnerDelay);
|
||||
this.onTick = options.onTick || defaultOnTick;
|
||||
this.stream = options.stream || process.stdout;
|
||||
};
|
||||
|
||||
Spinner.spinners = __webpack_require__(18138);
|
||||
|
||||
Spinner.setDefaultSpinnerString = function(value) {
|
||||
defaultSpinnerString = value;
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
Spinner.setDefaultSpinnerDelay = function(value) {
|
||||
defaultSpinnerDelay = value;
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
Spinner.prototype.start = function() {
|
||||
if(this.stream === process.stdout && this.stream.isTTY !== true) {
|
||||
return this;
|
||||
}
|
||||
|
||||
var current = 0;
|
||||
var self = this;
|
||||
|
||||
var iteration = function() {
|
||||
var msg = self.text.indexOf('%s') > -1
|
||||
? self.text.replace('%s', self.chars[current])
|
||||
: self.chars[current] + ' ' + self.text;
|
||||
|
||||
self.onTick(msg);
|
||||
|
||||
current = ++current % self.chars.length;
|
||||
};
|
||||
|
||||
iteration();
|
||||
this.id = setInterval(iteration, this.delay);
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
Spinner.prototype.isSpinning = function() {
|
||||
return this.id !== undefined;
|
||||
}
|
||||
|
||||
Spinner.prototype.setSpinnerDelay = function(n) {
|
||||
this.delay = n;
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
Spinner.prototype.setSpinnerString = function(str) {
|
||||
const map = mapToSpinner(str, this.spinners);
|
||||
this.chars = Array.isArray(map) ? map : map.split('');
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
Spinner.prototype.setSpinnerTitle = function(str) {
|
||||
this.text = str;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
Spinner.prototype.stop = function(clear) {
|
||||
if(this.isSpinning === false) {
|
||||
return this;
|
||||
}
|
||||
|
||||
clearInterval(this.id);
|
||||
this.id = undefined;
|
||||
|
||||
if (clear) {
|
||||
this.clearLine(this.stream);
|
||||
}
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
Spinner.prototype.clearLine = function(stream) {
|
||||
readline.clearLine(stream, 0);
|
||||
readline.cursorTo(stream, 0);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
// Helpers
|
||||
|
||||
function isInt(value) {
|
||||
return (typeof value==='number' && (value%1)===0);
|
||||
}
|
||||
|
||||
function mapToSpinner(value, spinners) {
|
||||
// Not an integer, return as strng
|
||||
if (!isInt(value)) {
|
||||
return value + '';
|
||||
}
|
||||
|
||||
var length = Spinner.spinners.length;
|
||||
|
||||
// Check if index is within bounds
|
||||
value = (value >= length) ? 0 : value;
|
||||
// If negative, count from the end
|
||||
value = (value < 0) ? length + value : value;
|
||||
|
||||
return Spinner.spinners[value];
|
||||
}
|
||||
|
||||
exports.Spinner = Spinner;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 41595:
|
||||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||||
|
||||
"use strict";
|
||||
|
||||
const fs = __webpack_require__(57147);
|
||||
|
||||
let isDocker;
|
||||
|
||||
function hasDockerEnv() {
|
||||
try {
|
||||
fs.statSync('/.dockerenv');
|
||||
return true;
|
||||
} catch (_) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function hasDockerCGroup() {
|
||||
try {
|
||||
return fs.readFileSync('/proc/self/cgroup', 'utf8').includes('docker');
|
||||
} catch (_) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = () => {
|
||||
if (isDocker === undefined) {
|
||||
isDocker = hasDockerEnv() || hasDockerCGroup();
|
||||
}
|
||||
|
||||
return isDocker;
|
||||
};
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 82818:
|
||||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||||
|
||||
"use strict";
|
||||
|
||||
const os = __webpack_require__(22037);
|
||||
const fs = __webpack_require__(57147);
|
||||
const isDocker = __webpack_require__(41595);
|
||||
|
||||
const isWsl = () => {
|
||||
if (process.platform !== 'linux') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (os.release().toLowerCase().includes('microsoft')) {
|
||||
if (isDocker()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
try {
|
||||
return fs.readFileSync('/proc/version', 'utf8').toLowerCase().includes('microsoft') ?
|
||||
!isDocker() : false;
|
||||
} catch (_) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
if (process.env.__IS_WSL_TEST__) {
|
||||
module.exports = isWsl;
|
||||
} else {
|
||||
module.exports = isWsl();
|
||||
}
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 78318:
|
||||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||||
|
||||
"use strict";
|
||||
|
||||
const {promisify} = __webpack_require__(73837);
|
||||
const path = __webpack_require__(71017);
|
||||
const childProcess = __webpack_require__(32081);
|
||||
const fs = __webpack_require__(57147);
|
||||
const isWsl = __webpack_require__(82818);
|
||||
const isDocker = __webpack_require__(41595);
|
||||
|
||||
const pAccess = promisify(fs.access);
|
||||
const pReadFile = promisify(fs.readFile);
|
||||
|
||||
// Path to included `xdg-open`.
|
||||
const localXdgOpenPath = path.join(__dirname, 'xdg-open');
|
||||
|
||||
/**
|
||||
Get the mount point for fixed drives in WSL.
|
||||
|
||||
@inner
|
||||
@returns {string} The mount point.
|
||||
*/
|
||||
const getWslDrivesMountPoint = (() => {
|
||||
// Default value for "root" param
|
||||
// according to https://docs.microsoft.com/en-us/windows/wsl/wsl-config
|
||||
const defaultMountPoint = '/mnt/';
|
||||
|
||||
let mountPoint;
|
||||
|
||||
return async function () {
|
||||
if (mountPoint) {
|
||||
// Return memoized mount point value
|
||||
return mountPoint;
|
||||
}
|
||||
|
||||
const configFilePath = '/etc/wsl.conf';
|
||||
|
||||
let isConfigFileExists = false;
|
||||
try {
|
||||
await pAccess(configFilePath, fs.constants.F_OK);
|
||||
isConfigFileExists = true;
|
||||
} catch (_) {}
|
||||
|
||||
if (!isConfigFileExists) {
|
||||
return defaultMountPoint;
|
||||
}
|
||||
|
||||
const configContent = await pReadFile(configFilePath, {encoding: 'utf8'});
|
||||
const configMountPoint = /root\s*=\s*(.*)/g.exec(configContent);
|
||||
|
||||
if (!configMountPoint) {
|
||||
return defaultMountPoint;
|
||||
}
|
||||
|
||||
mountPoint = configMountPoint[1].trim();
|
||||
mountPoint = mountPoint.endsWith('/') ? mountPoint : mountPoint + '/';
|
||||
|
||||
return mountPoint;
|
||||
};
|
||||
})();
|
||||
|
||||
module.exports = async (target, options) => {
|
||||
if (typeof target !== 'string') {
|
||||
throw new TypeError('Expected a `target`');
|
||||
}
|
||||
|
||||
options = {
|
||||
wait: false,
|
||||
background: false,
|
||||
allowNonzeroExitCode: false,
|
||||
...options
|
||||
};
|
||||
|
||||
let command;
|
||||
let {app} = options;
|
||||
let appArguments = [];
|
||||
const cliArguments = [];
|
||||
const childProcessOptions = {};
|
||||
|
||||
if (Array.isArray(app)) {
|
||||
appArguments = app.slice(1);
|
||||
app = app[0];
|
||||
}
|
||||
|
||||
if (process.platform === 'darwin') {
|
||||
command = 'open';
|
||||
|
||||
if (options.wait) {
|
||||
cliArguments.push('--wait-apps');
|
||||
}
|
||||
|
||||
if (options.background) {
|
||||
cliArguments.push('--background');
|
||||
}
|
||||
|
||||
if (app) {
|
||||
cliArguments.push('-a', app);
|
||||
}
|
||||
} else if (process.platform === 'win32' || (isWsl && !isDocker())) {
|
||||
const mountPoint = await getWslDrivesMountPoint();
|
||||
|
||||
command = isWsl ?
|
||||
`${mountPoint}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe` :
|
||||
`${process.env.SYSTEMROOT}\\System32\\WindowsPowerShell\\v1.0\\powershell`;
|
||||
|
||||
cliArguments.push(
|
||||
'-NoProfile',
|
||||
'-NonInteractive',
|
||||
'–ExecutionPolicy',
|
||||
'Bypass',
|
||||
'-EncodedCommand'
|
||||
);
|
||||
|
||||
if (!isWsl) {
|
||||
childProcessOptions.windowsVerbatimArguments = true;
|
||||
}
|
||||
|
||||
const encodedArguments = ['Start'];
|
||||
|
||||
if (options.wait) {
|
||||
encodedArguments.push('-Wait');
|
||||
}
|
||||
|
||||
if (app) {
|
||||
// Double quote with double quotes to ensure the inner quotes are passed through.
|
||||
// Inner quotes are delimited for PowerShell interpretation with backticks.
|
||||
encodedArguments.push(`"\`"${app}\`""`, '-ArgumentList');
|
||||
appArguments.unshift(target);
|
||||
} else {
|
||||
encodedArguments.push(`"${target}"`);
|
||||
}
|
||||
|
||||
if (appArguments.length > 0) {
|
||||
appArguments = appArguments.map(arg => `"\`"${arg}\`""`);
|
||||
encodedArguments.push(appArguments.join(','));
|
||||
}
|
||||
|
||||
// Using Base64-encoded command, accepted by PowerShell, to allow special characters.
|
||||
target = Buffer.from(encodedArguments.join(' '), 'utf16le').toString('base64');
|
||||
} else {
|
||||
if (app) {
|
||||
command = app;
|
||||
} else {
|
||||
// When bundled by Webpack, there's no actual package file path and no local `xdg-open`.
|
||||
const isBundled = !__dirname || __dirname === '/';
|
||||
|
||||
// Check if local `xdg-open` exists and is executable.
|
||||
let exeLocalXdgOpen = false;
|
||||
try {
|
||||
await pAccess(localXdgOpenPath, fs.constants.X_OK);
|
||||
exeLocalXdgOpen = true;
|
||||
} catch (_) {}
|
||||
|
||||
const useSystemXdgOpen = process.versions.electron ||
|
||||
process.platform === 'android' || isBundled || !exeLocalXdgOpen;
|
||||
command = useSystemXdgOpen ? 'xdg-open' : localXdgOpenPath;
|
||||
}
|
||||
|
||||
if (appArguments.length > 0) {
|
||||
cliArguments.push(...appArguments);
|
||||
}
|
||||
|
||||
if (!options.wait) {
|
||||
// `xdg-open` will block the process unless stdio is ignored
|
||||
// and it's detached from the parent even if it's unref'd.
|
||||
childProcessOptions.stdio = 'ignore';
|
||||
childProcessOptions.detached = true;
|
||||
}
|
||||
}
|
||||
|
||||
cliArguments.push(target);
|
||||
|
||||
if (process.platform === 'darwin' && appArguments.length > 0) {
|
||||
cliArguments.push('--args', ...appArguments);
|
||||
}
|
||||
|
||||
const subprocess = childProcess.spawn(command, cliArguments, childProcessOptions);
|
||||
|
||||
if (options.wait) {
|
||||
return new Promise((resolve, reject) => {
|
||||
subprocess.once('error', reject);
|
||||
|
||||
subprocess.once('close', exitCode => {
|
||||
if (options.allowNonzeroExitCode && exitCode > 0) {
|
||||
reject(new Error(`Exited with code ${exitCode}`));
|
||||
return;
|
||||
}
|
||||
|
||||
resolve(subprocess);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
subprocess.unref();
|
||||
|
||||
return subprocess;
|
||||
};
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 27974:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
const open = __webpack_require__(78318);
|
||||
const uuid_1 = __webpack_require__(96771);
|
||||
const Debug = __webpack_require__(15158);
|
||||
const cli_spinner_1 = __webpack_require__(62148);
|
||||
const snyk = __webpack_require__(9146);
|
||||
const verify_1 = __webpack_require__(23144);
|
||||
const is_ci_1 = __webpack_require__(10090);
|
||||
const is_docker_1 = __webpack_require__(14953);
|
||||
const args_1 = __webpack_require__(94765);
|
||||
const config_1 = __webpack_require__(25425);
|
||||
const request_1 = __webpack_require__(52050);
|
||||
const errors_1 = __webpack_require__(55191);
|
||||
const errors_2 = __webpack_require__(55191);
|
||||
const token_expired_error_1 = __webpack_require__(79578);
|
||||
const misconfigured_auth_in_ci_error_1 = __webpack_require__(27747);
|
||||
const query_strings_1 = __webpack_require__(36479);
|
||||
const apiUrl = new URL(config_1.default.API);
|
||||
// Ensure user gets redirected to the login page
|
||||
if (apiUrl.host.startsWith('api.')) {
|
||||
apiUrl.host = apiUrl.host.replace(/^api\./, 'app.');
|
||||
}
|
||||
const debug = Debug('snyk-auth');
|
||||
let attemptsLeft = 0;
|
||||
function resetAttempts() {
|
||||
attemptsLeft = (0, is_docker_1.isDocker)() ? 60 : 3 * 60;
|
||||
}
|
||||
async function webAuth() {
|
||||
const token = (0, uuid_1.v4)(); // generate a random key
|
||||
apiUrl.pathname = '/login';
|
||||
apiUrl.searchParams.append('token', token);
|
||||
let urlStr = apiUrl.toString();
|
||||
// It's not optimal, but I have to parse args again here. Alternative is reworking everything about how we parse args
|
||||
const args = [(0, args_1.args)(process.argv).options];
|
||||
const utmParams = (0, query_strings_1.getQueryParamsAsString)(args);
|
||||
if (utmParams) {
|
||||
urlStr += '&' + utmParams;
|
||||
}
|
||||
// suppress this message in CI
|
||||
if (!(0, is_ci_1.isCI)()) {
|
||||
console.log(browserAuthPrompt((0, is_docker_1.isDocker)(), urlStr));
|
||||
}
|
||||
else {
|
||||
return Promise.reject((0, misconfigured_auth_in_ci_error_1.MisconfiguredAuthInCI)());
|
||||
}
|
||||
const spinner = new cli_spinner_1.Spinner('Waiting...');
|
||||
spinner.setSpinnerString('|/-\\');
|
||||
const ipFamily = await getIpFamily();
|
||||
try {
|
||||
spinner.start();
|
||||
if (!(0, is_docker_1.isDocker)()) {
|
||||
await setTimeout(() => {
|
||||
open(urlStr);
|
||||
}, 0);
|
||||
}
|
||||
return await testAuthComplete(token, ipFamily);
|
||||
}
|
||||
finally {
|
||||
spinner.stop(true);
|
||||
}
|
||||
}
|
||||
async function testAuthComplete(token, ipFamily) {
|
||||
const payload = {
|
||||
body: {
|
||||
token,
|
||||
},
|
||||
url: config_1.default.API + '/verify/callback',
|
||||
json: true,
|
||||
method: 'post',
|
||||
};
|
||||
if (ipFamily) {
|
||||
payload.family = ipFamily;
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
debug(payload);
|
||||
(0, request_1.makeRequest)(payload, (error, res, body) => {
|
||||
debug(error, (res || {}).statusCode, body);
|
||||
if (error) {
|
||||
return reject(error);
|
||||
}
|
||||
if (res.statusCode !== 200) {
|
||||
return reject(errorForFailedAuthAttempt(res, body));
|
||||
}
|
||||
// we have success
|
||||
if (body.api) {
|
||||
return resolve({
|
||||
res,
|
||||
body,
|
||||
});
|
||||
}
|
||||
// we need to wait and poll again in a moment
|
||||
setTimeout(() => {
|
||||
attemptsLeft--;
|
||||
if (attemptsLeft > 0) {
|
||||
return resolve(testAuthComplete(token, ipFamily));
|
||||
}
|
||||
reject((0, token_expired_error_1.TokenExpiredError)());
|
||||
}, 1000);
|
||||
});
|
||||
});
|
||||
}
|
||||
async function auth(apiToken) {
|
||||
let promise;
|
||||
resetAttempts();
|
||||
if (apiToken) {
|
||||
// user is manually setting the API token on the CLI - let's trust them
|
||||
promise = (0, verify_1.verifyAPI)(apiToken);
|
||||
}
|
||||
else {
|
||||
promise = webAuth();
|
||||
}
|
||||
return promise.then((data) => {
|
||||
const res = data.res;
|
||||
const body = res.body;
|
||||
debug(body);
|
||||
if (res.statusCode === 200 || res.statusCode === 201) {
|
||||
snyk.config.set('api', body.api);
|
||||
return ('\nYour account has been authenticated. Snyk is now ready to ' +
|
||||
'be used.\n');
|
||||
}
|
||||
throw errorForFailedAuthAttempt(res, body);
|
||||
});
|
||||
}
|
||||
exports["default"] = auth;
|
||||
/**
|
||||
* Resolve an appropriate error for a failed attempt to authenticate
|
||||
*
|
||||
* @param res The response from the API
|
||||
* @param body The body of the failed authentication request
|
||||
*/
|
||||
function errorForFailedAuthAttempt(res, body) {
|
||||
if (res.statusCode === 401 || res.statusCode === 403) {
|
||||
return (0, errors_2.AuthFailedError)(body.userMessage, res.statusCode);
|
||||
}
|
||||
else {
|
||||
const userMessage = body && body.userMessage;
|
||||
const error = new errors_1.CustomError(userMessage || 'Auth request failed');
|
||||
if (userMessage) {
|
||||
error.userMessage = userMessage;
|
||||
}
|
||||
error.code = res.statusCode;
|
||||
return error;
|
||||
}
|
||||
}
|
||||
async function getIpFamily() {
|
||||
const family = 6;
|
||||
try {
|
||||
// Dispatch a FORCED IPv6 request to test client's ISP and network capability
|
||||
await (0, request_1.makeRequest)({
|
||||
url: config_1.default.API + '/verify/callback',
|
||||
family,
|
||||
method: 'post',
|
||||
});
|
||||
return family;
|
||||
}
|
||||
catch (e) {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
function browserAuthPrompt(isDocker, urlStr) {
|
||||
if (isDocker) {
|
||||
return ('\nTo authenticate your account, open the below URL in your browser.\n' +
|
||||
'After your authentication is complete, return to this prompt to ' +
|
||||
'start using Snyk.\n\n' +
|
||||
urlStr +
|
||||
'\n');
|
||||
}
|
||||
else {
|
||||
return ('\nNow redirecting you to our auth page, go ahead and log in,\n' +
|
||||
"and once the auth is complete, return to this prompt and you'll\n" +
|
||||
"be ready to start using snyk.\n\nIf you can't wait use this url:\n" +
|
||||
urlStr +
|
||||
'\n');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 23144:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.verifyAPI = void 0;
|
||||
const config_1 = __webpack_require__(25425);
|
||||
const request_1 = __webpack_require__(52050);
|
||||
function verifyAPI(api) {
|
||||
const payload = {
|
||||
body: {
|
||||
api,
|
||||
},
|
||||
method: 'POST',
|
||||
url: config_1.default.API + '/verify/token',
|
||||
json: true,
|
||||
};
|
||||
return new Promise((resolve, reject) => {
|
||||
(0, request_1.makeRequest)(payload, (error, res, body) => {
|
||||
if (error) {
|
||||
return reject(error);
|
||||
}
|
||||
resolve({
|
||||
res,
|
||||
body,
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
exports.verifyAPI = verifyAPI;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 27747:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.MisconfiguredAuthInCI = void 0;
|
||||
const error_catalog_nodejs_public_1 = __webpack_require__(88404);
|
||||
const custom_error_1 = __webpack_require__(17188);
|
||||
function MisconfiguredAuthInCI() {
|
||||
const errorMsg = 'Snyk is missing auth token in order to run inside CI. You must include ' +
|
||||
'your API token as an environment value: `SNYK_TOKEN=12345678`';
|
||||
const error = new custom_error_1.CustomError(errorMsg);
|
||||
error.code = 401;
|
||||
error.strCode = 'noAuthInCI';
|
||||
error.userMessage = errorMsg;
|
||||
error.errorCatalog = new error_catalog_nodejs_public_1.CLI.AuthConfigError('');
|
||||
return error;
|
||||
}
|
||||
exports.MisconfiguredAuthInCI = MisconfiguredAuthInCI;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 79578:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.TokenExpiredError = void 0;
|
||||
const error_catalog_nodejs_public_1 = __webpack_require__(88404);
|
||||
const custom_error_1 = __webpack_require__(17188);
|
||||
function TokenExpiredError() {
|
||||
const errorMsg = 'Sorry, but your authentication token has now' +
|
||||
' expired.\nPlease try to authenticate again.';
|
||||
const error = new custom_error_1.CustomError(errorMsg);
|
||||
error.code = 401;
|
||||
error.strCode = 'AUTH_TIMEOUT';
|
||||
error.userMessage = errorMsg;
|
||||
error.errorCatalog = new error_catalog_nodejs_public_1.CLI.AuthConfigError('');
|
||||
return error;
|
||||
}
|
||||
exports.TokenExpiredError = TokenExpiredError;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 14953:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.isDocker = void 0;
|
||||
const fs = __webpack_require__(57147);
|
||||
function isDocker() {
|
||||
return hasDockerEnv() || hasDockerCGroup();
|
||||
}
|
||||
exports.isDocker = isDocker;
|
||||
function hasDockerEnv() {
|
||||
try {
|
||||
fs.statSync('/.dockerenv');
|
||||
return true;
|
||||
}
|
||||
catch (_) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function hasDockerCGroup() {
|
||||
try {
|
||||
return fs.readFileSync('/proc/self/cgroup', 'utf8').includes('docker');
|
||||
}
|
||||
catch (_) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 36479:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.getQueryParamsAsString = void 0;
|
||||
const url = __webpack_require__(57310);
|
||||
const os = __webpack_require__(22037);
|
||||
const is_docker_1 = __webpack_require__(14953);
|
||||
const sources_1 = __webpack_require__(71653);
|
||||
function getQueryParamsAsString(args) {
|
||||
var _a;
|
||||
const utm_source = process.env.SNYK_UTM_SOURCE || 'cli';
|
||||
const utm_medium = process.env.SNYK_UTM_MEDIUM || 'cli';
|
||||
const utm_campaign = process.env.SNYK_UTM_CAMPAIGN || (0, sources_1.getIntegrationName)(args) || 'cli';
|
||||
const utm_campaign_content = process.env.SNYK_UTM_CAMPAIGN_CONTENT || (0, sources_1.getIntegrationVersion)(args);
|
||||
const osType = (_a = os.type()) === null || _a === void 0 ? void 0 : _a.toLowerCase();
|
||||
const docker = (0, is_docker_1.isDocker)().toString();
|
||||
const queryParams = new url.URLSearchParams({
|
||||
utm_medium,
|
||||
utm_source,
|
||||
utm_campaign,
|
||||
utm_campaign_content,
|
||||
os: osType,
|
||||
docker,
|
||||
});
|
||||
// It may not be set and URLSearchParams won't filter out undefined values
|
||||
if (!utm_campaign_content) {
|
||||
queryParams.delete('utm_campaign_content');
|
||||
}
|
||||
return queryParams.toString();
|
||||
}
|
||||
exports.getQueryParamsAsString = getQueryParamsAsString;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 18138:
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = JSON.parse('["|/-\\\\","⠂-–—–-","◐◓◑◒","◴◷◶◵","◰◳◲◱","▖▘▝▗","■□▪▫","▌▀▐▄","▉▊▋▌▍▎▏▎▍▌▋▊▉","▁▃▄▅▆▇█▇▆▅▄▃","←↖↑↗→↘↓↙","┤┘┴└├┌┬┐","◢◣◤◥",".oO°Oo.",".oO@*",["🌍","🌎","🌏"],"◡◡ ⊙⊙ ◠◠","☱☲☴","⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏","⠋⠙⠚⠞⠖⠦⠴⠲⠳⠓","⠄⠆⠇⠋⠙⠸⠰⠠⠰⠸⠙⠋⠇⠆","⠋⠙⠚⠒⠂⠂⠒⠲⠴⠦⠖⠒⠐⠐⠒⠓⠋","⠁⠉⠙⠚⠒⠂⠂⠒⠲⠴⠤⠄⠄⠤⠴⠲⠒⠂⠂⠒⠚⠙⠉⠁","⠈⠉⠋⠓⠒⠐⠐⠒⠖⠦⠤⠠⠠⠤⠦⠖⠒⠐⠐⠒⠓⠋⠉⠈","⠁⠁⠉⠙⠚⠒⠂⠂⠒⠲⠴⠤⠄⠄⠤⠠⠠⠤⠦⠖⠒⠐⠐⠒⠓⠋⠉⠈⠈","⢄⢂⢁⡁⡈⡐⡠","⢹⢺⢼⣸⣇⡧⡗⡏","⣾⣽⣻⢿⡿⣟⣯⣷","⠁⠂⠄⡀⢀⠠⠐⠈",["🌑","🌒","🌓","🌔","🌕","🌝","🌖","🌗","🌘","🌚"],["🕛","🕐","🕑","🕒","🕓","🕔","🕕","🕖","🕗","🕘","🕙","🕚"]]');
|
||||
|
||||
/***/ })
|
||||
|
||||
};
|
||||
;
|
||||
//# sourceMappingURL=974.index.js.map
|
||||
1
safekiso-server/node_modules/snyk/dist/cli/974.index.js.map
generated
vendored
Normal file
1
safekiso-server/node_modules/snyk/dist/cli/974.index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
482
safekiso-server/node_modules/snyk/dist/cli/989.index.js
generated
vendored
Normal file
482
safekiso-server/node_modules/snyk/dist/cli/989.index.js
generated
vendored
Normal file
@@ -0,0 +1,482 @@
|
||||
"use strict";
|
||||
exports.id = 989;
|
||||
exports.ids = [989];
|
||||
exports.modules = {
|
||||
|
||||
/***/ 60959:
|
||||
/***/ ((__unused_webpack_module, exports) => {
|
||||
|
||||
|
||||
/**
|
||||
* The content of this file is generated by a tool.
|
||||
* Don't edit it manually!
|
||||
* */
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.vulnerableSignatures = void 0;
|
||||
exports.vulnerableSignatures = {
|
||||
IfBVtiwVRT8NeXCp2ZTKtw: {
|
||||
filename: 'JndiManager.class',
|
||||
versions: ['2.13.2', '2.13.1', '2.13.0', '2.13.3'],
|
||||
},
|
||||
CsWz5uabp3ZWg3mOZpowsg: {
|
||||
filename: 'log4j-core-2.13.2.jar',
|
||||
versions: ['2.13.2'],
|
||||
},
|
||||
'8MQ62soq/HHGzID4UbOIGA': {
|
||||
filename: 'log4j-core-2.4.1.jar',
|
||||
versions: ['2.4.1'],
|
||||
},
|
||||
RyyOH7qg5hUg4CXCVbXRaA: {
|
||||
filename: 'log4j-core-2.6.2.jar',
|
||||
versions: ['2.6.2'],
|
||||
},
|
||||
'7Q4xglxv2kNCP7ODV6QrPQ': {
|
||||
filename: 'MessagePatternConverter.class',
|
||||
versions: ['2.16.0'],
|
||||
},
|
||||
geBDOuAGAsDk0AQk0hOwqw: {
|
||||
filename: 'log4j-core-2.15.0.jar',
|
||||
versions: ['2.15.0'],
|
||||
},
|
||||
'miPB9v/sgl70HMwQVBogkA': {
|
||||
filename: 'JndiManager.java',
|
||||
versions: ['2.8.2-sources', '2.8-sources', '2.7-sources', '2.8.1-sources'],
|
||||
},
|
||||
WCRxHWxoFi61NcxNv3SF0w: {
|
||||
filename: 'JndiManager.class',
|
||||
versions: ['2.12.1', '2.12.0'],
|
||||
},
|
||||
'xtIzvI6c/l2mkAWdJ9n4jw': {
|
||||
filename: 'log4j-core-2.8.jar',
|
||||
versions: ['2.8'],
|
||||
},
|
||||
zH1V7WnMX9NANbFcbt95oA: {
|
||||
filename: 'log4j-core-2.13.3.jar',
|
||||
versions: ['2.13.3'],
|
||||
},
|
||||
'EQqz4+TzeAkh6O5d3jNzrQ': {
|
||||
filename: 'log4j-core-2.3.jar',
|
||||
versions: ['2.3'],
|
||||
},
|
||||
'VSPxRPrvK/ygijyosr7Nag': {
|
||||
filename: 'log4j-core-2.6.jar',
|
||||
versions: ['2.6'],
|
||||
},
|
||||
'C1fpJhCjMxrxWn6Q+LNTnQ': {
|
||||
filename: 'Interpolator.class',
|
||||
versions: ['2.16.0'],
|
||||
},
|
||||
'QVwT58hQX7BW1UDqwpty+g': {
|
||||
filename: 'JndiManager.class',
|
||||
versions: ['2.7', '2.8.1', '2.8'],
|
||||
},
|
||||
zXChiI7N0xHBmQ54SGfOHg: {
|
||||
filename: 'log4j-core-2.0.jar',
|
||||
versions: ['2.0'],
|
||||
},
|
||||
'txoT/V3yUWlPyhFiQAA7Ig': {
|
||||
filename: 'log4j-core-2.13.0.jar',
|
||||
versions: ['2.13.0'],
|
||||
},
|
||||
VHuz7S3rhW0OO713wnuWJQ: {
|
||||
filename: 'log4j-core-2.8.1.jar',
|
||||
versions: ['2.8.1'],
|
||||
},
|
||||
SlF3oXJ2S9pvRHK5S6F8yw: {
|
||||
filename: 'log4j-core-2.8.2.jar',
|
||||
versions: ['2.8.2'],
|
||||
},
|
||||
ToAy4jACKoyI3X1SbwtnCw: {
|
||||
filename: 'JndiManager.java',
|
||||
versions: [
|
||||
'2.9.0-sources',
|
||||
'2.9.1-sources',
|
||||
'2.10.0-sources',
|
||||
'2.11.0-sources',
|
||||
'2.11.1-sources',
|
||||
],
|
||||
},
|
||||
'oZNwOQSj8Y+zyQqHfrXIpw': {
|
||||
filename: 'JndiManager.class',
|
||||
versions: ['2.8.2'],
|
||||
},
|
||||
'+/pfM6tLKab91SRz7nuDTQ': {
|
||||
filename: 'log4j-core-2.0.1.jar',
|
||||
versions: ['2.0.1'],
|
||||
},
|
||||
'Kr7CzmZeDVKaPyj/+7st0w': {
|
||||
filename: 'log4j-core-2.11.0.jar',
|
||||
versions: ['2.11.0'],
|
||||
},
|
||||
'AHnJByMGWZaPD8DkGmq8+Q': {
|
||||
filename: 'log4j-core-2.4.jar',
|
||||
versions: ['2.4'],
|
||||
},
|
||||
'3o0BzBX9DHT+qLu2aOKJ9Q': {
|
||||
filename: 'log4j-core-2.0-rc2.jar',
|
||||
versions: ['2.0-rc2.jar'],
|
||||
},
|
||||
'siQt4Gd75lFdbO+/SOfl1Q': {
|
||||
filename: 'log4j-core-2.11.1.jar',
|
||||
versions: ['2.11.1'],
|
||||
},
|
||||
jTMVRLLnsgrRZt68olUNcw: {
|
||||
filename: 'log4j-core-2.1.jar',
|
||||
versions: ['2.1'],
|
||||
},
|
||||
'3Q4+C0BAg+xpYYqrtQuKwA': {
|
||||
filename: 'log4j-core-2.5.jar',
|
||||
versions: ['2.5'],
|
||||
},
|
||||
BP3XAYCdF0ZcF8fmA7GyAg: {
|
||||
filename: 'JndiManager.class',
|
||||
versions: ['2.11.1', '2.9.1', '2.11.0', '2.11.2', '2.10.0', '2.9.0'],
|
||||
},
|
||||
FS7LPOCUrFvJ6jnWEi4oFA: {
|
||||
filename: 'log4j-core-2.0-beta9.jar',
|
||||
versions: ['2.0-beta9.jar'],
|
||||
},
|
||||
'SPfzzaUwMKh+jDh9jR5CZQ': {
|
||||
filename: 'log4j-core-2.6.1.jar',
|
||||
versions: ['2.6.1'],
|
||||
},
|
||||
'axX0LDM6w5q6z+7rGIUqRA': {
|
||||
filename: 'JndiManager.class',
|
||||
versions: ['2.1', '2.2', '2.3'],
|
||||
},
|
||||
'XkvKXtILlKsZu2WDbak/lg': {
|
||||
filename: 'log4j-core-2.2.jar',
|
||||
versions: ['2.2'],
|
||||
},
|
||||
lI3aeHWTNAp68aGOMot7fw: {
|
||||
filename: 'log4j-core-2.14.1.jar',
|
||||
versions: ['2.14.1'],
|
||||
},
|
||||
'K2Pg5QY/2sz2aaHiY4Tz/Q': {
|
||||
filename: 'log4j-core-2.7.jar',
|
||||
versions: ['2.7'],
|
||||
},
|
||||
'iyJgsczmQUT2MQh2+UsWOA': {
|
||||
filename: 'JndiManager.class',
|
||||
versions: ['2.4', '2.4.1', '2.5'],
|
||||
},
|
||||
'CI3xE60kmrcr8Zt/ALhj1Q': {
|
||||
filename: 'log4j-core-2.0-rc1.jar',
|
||||
versions: ['2.0-rc1.jar'],
|
||||
},
|
||||
'3JkBHwR+Y9zHQbWraNEW2w': {
|
||||
filename: 'log4j-core-2.10.0.jar',
|
||||
versions: ['2.10.0'],
|
||||
},
|
||||
'XFJ4IdEISn7z4D1AFE/1Mg': {
|
||||
filename: 'log4j-core-2.12.0.jar',
|
||||
versions: ['2.12.0'],
|
||||
},
|
||||
n0GSikGCAN4iMt0yblIsxw: {
|
||||
filename: 'log4j-core-2.16.0.jar',
|
||||
versions: ['2.16.0'],
|
||||
},
|
||||
'XSU+U/qZPhIv8BIiGqSeww': {
|
||||
filename: 'JndiManager.class',
|
||||
versions: ['2.15.0'],
|
||||
},
|
||||
'NbG1m0kl+RbQmdW4+7nykQ': {
|
||||
filename: 'JndiManager.java',
|
||||
versions: [
|
||||
'2.11.2-sources',
|
||||
'2.12.1-sources',
|
||||
'2.13.0-sources',
|
||||
'2.13.1-sources',
|
||||
'2.13.2-sources',
|
||||
'2.14.1-sources',
|
||||
'2.12.0-sources',
|
||||
'2.13.3-sources',
|
||||
'2.14.0-sources',
|
||||
],
|
||||
},
|
||||
'Kn94Du0/K5zJ8p4blmlGjw': {
|
||||
filename: 'JndiManager.java',
|
||||
versions: [
|
||||
'2.4-sources',
|
||||
'2.2-sources',
|
||||
'2.3-sources',
|
||||
'2.5-sources',
|
||||
'2.6.1-sources',
|
||||
'2.6.2-sources',
|
||||
'2.6-sources',
|
||||
'2.1-sources',
|
||||
'2.4.1-sources',
|
||||
],
|
||||
},
|
||||
'02XkgiFBT5P+7wk6G/YH7w': {
|
||||
filename: 'log4j-core-2.13.1.jar',
|
||||
versions: ['2.13.1'],
|
||||
},
|
||||
'+rZGJX+UWwsqfOPhw+POXw': {
|
||||
filename: 'log4j-core-2.9.0.jar',
|
||||
versions: ['2.9.0'],
|
||||
},
|
||||
'lC9Cnqy4AV4Y2PWZls++5g': {
|
||||
filename: 'log4j-core-2.9.1.jar',
|
||||
versions: ['2.9.1'],
|
||||
},
|
||||
'yL2LXFqqoHo9y/V94BySZg': {
|
||||
filename: 'log4j-core-2.11.2.jar',
|
||||
versions: ['2.11.2'],
|
||||
},
|
||||
ATi6HBkdXHVP0OPDphwDBw: {
|
||||
filename: 'log4j-core-2.12.1.jar',
|
||||
versions: ['2.12.1'],
|
||||
},
|
||||
'hiwAsuhU+cDx6NhAnSPYmQ': {
|
||||
filename: 'log4j-core-2.14.0.jar',
|
||||
versions: ['2.14.0'],
|
||||
},
|
||||
'uhz4+B57MccJdoVhuoq1WA': {
|
||||
filename: 'JndiManager.class',
|
||||
versions: ['2.16.0'],
|
||||
},
|
||||
'O9n0G4nOT+jMv3PkMZWlzg': {
|
||||
filename: 'JndiManager.class',
|
||||
versions: ['2.6.1', '2.6', '2.6.2'],
|
||||
},
|
||||
'8dYwxIkoCWpITkuVzLFioA': {
|
||||
filename: 'JndiManager.class',
|
||||
versions: ['2.14.0', '2.14.1'],
|
||||
},
|
||||
jAzz6wRxVKT44W2vWiCTGQ: {
|
||||
filename: 'log4j-core-2.0.2.jar',
|
||||
versions: ['2.0.2'],
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 86989:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
const fs_1 = __webpack_require__(57147);
|
||||
const crypto = __webpack_require__(6113);
|
||||
const AdmZip = __webpack_require__(55285);
|
||||
const ora = __webpack_require__(63395);
|
||||
const semver = __webpack_require__(36625);
|
||||
const log4shell_hashes_1 = __webpack_require__(60959);
|
||||
const readFile = fs_1.promises.readFile;
|
||||
const readDir = fs_1.promises.readdir;
|
||||
const stat = fs_1.promises.stat;
|
||||
const MAX_FILE_SIZE = 2 * 1024 * 1024 * 1024 - 1;
|
||||
class Paths {
|
||||
constructor(paths) {
|
||||
this.paths = paths;
|
||||
}
|
||||
static empty() {
|
||||
return new Paths([]);
|
||||
}
|
||||
static fromZip(content, path) {
|
||||
try {
|
||||
const unzippedEntries = new AdmZip(content).getEntries();
|
||||
const entries = unzippedEntries.map((entry) => {
|
||||
return {
|
||||
path: path + '/' + entry.entryName,
|
||||
content: async () => entry.getData(),
|
||||
};
|
||||
});
|
||||
return new Paths(entries);
|
||||
}
|
||||
catch (error) {
|
||||
errors.push(error);
|
||||
return this.empty();
|
||||
}
|
||||
}
|
||||
static async fromDisk(paths) {
|
||||
try {
|
||||
const entries = paths.map((path) => {
|
||||
return {
|
||||
path,
|
||||
content: async () => await readFile(path),
|
||||
};
|
||||
});
|
||||
return new Paths(entries);
|
||||
}
|
||||
catch (error) {
|
||||
errors.push(error);
|
||||
return this.empty();
|
||||
}
|
||||
}
|
||||
}
|
||||
const errors = [];
|
||||
async function startSpinner() {
|
||||
const spinner = ora({ isSilent: false, stream: process.stdout });
|
||||
spinner.text = `Looking for Log4Shell...`;
|
||||
spinner.start();
|
||||
return spinner;
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
async function log4shell(...args) {
|
||||
console.log('Please note this command is for already built artifacts. To test source code please use `snyk test`.');
|
||||
const signatures = new Array();
|
||||
const spinner = await startSpinner();
|
||||
const paths = await find('.');
|
||||
await parsePaths(await Paths.fromDisk(paths), signatures);
|
||||
spinner.stop();
|
||||
console.log('\nResults:');
|
||||
const issues = filterJndi(signatures);
|
||||
if (issues.length == 0) {
|
||||
console.log('No known vulnerable version of Log4J was detected');
|
||||
return;
|
||||
}
|
||||
const rceIssues = [];
|
||||
const dosIssues = [];
|
||||
issues.forEach((issue) => {
|
||||
issue.path = issue.path.replace(/(.*org\/apache\/logging\/log4j\/core).*/, '$1');
|
||||
if (issue.exploitType === 'Log4Shell') {
|
||||
rceIssues.push(issue);
|
||||
}
|
||||
if (issue.exploitType === 'DoS') {
|
||||
dosIssues.push(issue);
|
||||
}
|
||||
});
|
||||
if (rceIssues.length > 0) {
|
||||
displayIssues('A version of Log4J that is vulnerable to Log4Shell was detected:', rceIssues);
|
||||
displayRemediation('Log4Shell');
|
||||
}
|
||||
if (dosIssues.length > 0) {
|
||||
displayIssues('A version of Log4J that is vulnerable to CVE-2021-45105 (Denial of Service) was detected:', dosIssues);
|
||||
displayRemediation('DoS');
|
||||
}
|
||||
exitWithError();
|
||||
}
|
||||
exports["default"] = log4shell;
|
||||
async function parsePaths(ctx, accumulator) {
|
||||
for (const { path, content } of ctx.paths) {
|
||||
if (!isArchiveOrJndi(path)) {
|
||||
continue;
|
||||
}
|
||||
const signature = await computeSignature(await content());
|
||||
const isVulnerable = signature in log4shell_hashes_1.vulnerableSignatures;
|
||||
if (isVulnerable || path.includes('JndiLookup')) {
|
||||
await append(path, signature, accumulator);
|
||||
continue;
|
||||
}
|
||||
if (!isVulnerable && isJavaArchive(path)) {
|
||||
await parsePaths(Paths.fromZip(await content(), path), accumulator);
|
||||
}
|
||||
}
|
||||
}
|
||||
async function computeSignature(content) {
|
||||
return crypto
|
||||
.createHash('md5')
|
||||
.update(content)
|
||||
.digest('base64')
|
||||
.replace(/=/g, '');
|
||||
}
|
||||
async function find(path) {
|
||||
const result = [];
|
||||
await traverse(path, (filePath, stats) => {
|
||||
if (!stats.isFile() || stats.size > MAX_FILE_SIZE) {
|
||||
return;
|
||||
}
|
||||
result.push(filePath);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
async function traverse(path, handle) {
|
||||
try {
|
||||
const stats = await stat(path);
|
||||
if (!stats.isDirectory()) {
|
||||
handle(path, stats);
|
||||
return;
|
||||
}
|
||||
const entries = await readDir(path);
|
||||
for (const entry of entries) {
|
||||
const absolute = path + '/' + entry;
|
||||
await traverse(absolute, handle);
|
||||
}
|
||||
}
|
||||
catch (error) {
|
||||
errors.push(error);
|
||||
}
|
||||
}
|
||||
async function computeExploitType(signatureDetails) {
|
||||
for (const version of signatureDetails.versions) {
|
||||
const coercedVersion = semver.coerce(version);
|
||||
if (coercedVersion === null) {
|
||||
continue;
|
||||
}
|
||||
if (semver.lt(coercedVersion, '2.16.0')) {
|
||||
return 'Log4Shell';
|
||||
}
|
||||
if (semver.satisfies(coercedVersion, '2.16.x')) {
|
||||
return 'DoS';
|
||||
}
|
||||
}
|
||||
return 'Unknown';
|
||||
}
|
||||
function displayIssues(message, signatures) {
|
||||
console.log(message);
|
||||
signatures.forEach((signature) => {
|
||||
console.log(`\t${signature.path}`);
|
||||
});
|
||||
}
|
||||
function displayRemediation(exploitType) {
|
||||
switch (exploitType) {
|
||||
case 'Log4Shell':
|
||||
console.log(`\nWe highly recommend fixing this vulnerability. If it cannot be fixed by upgrading, see mitigation information here:
|
||||
\t- https://security.snyk.io/vuln/SNYK-JAVA-ORGAPACHELOGGINGLOG4J-2314720
|
||||
\t- https://snyk.io/blog/log4shell-remediation-cheat-sheet/\n`);
|
||||
break;
|
||||
case 'DoS':
|
||||
console.log(`\nWe recommend fixing this vulnerability by upgrading to a later version. To learn more about this vulnerability, see:
|
||||
\t- https://security.snyk.io/vuln/SNYK-JAVA-ORGAPACHELOGGINGLOG4J-2321524\n`);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
function isJavaArchive(path) {
|
||||
return path.endsWith('.jar') || path.endsWith('.war') || path.endsWith('ear');
|
||||
}
|
||||
function isArchiveOrJndi(path) {
|
||||
return (isJavaArchive(path) ||
|
||||
path.includes('JndiManager') ||
|
||||
path.includes('JndiLookup'));
|
||||
}
|
||||
async function append(path, signature, accumulator) {
|
||||
const exploitType = log4shell_hashes_1.vulnerableSignatures[signature]
|
||||
? await computeExploitType(log4shell_hashes_1.vulnerableSignatures[signature])
|
||||
: 'Unknown';
|
||||
accumulator.push({
|
||||
value: signature,
|
||||
path,
|
||||
exploitType,
|
||||
});
|
||||
}
|
||||
function filterJndi(signatures) {
|
||||
return signatures.filter((signature) => {
|
||||
if (isJavaArchive(signature.path)) {
|
||||
return true;
|
||||
}
|
||||
if (signature.path.includes('JndiManager')) {
|
||||
const jndiManagerPathIndex = signature.path.indexOf('/net/JndiManager.class');
|
||||
const jndiLookupPath = signature.path.substr(0, jndiManagerPathIndex) + '/lookup/JndiLookup';
|
||||
const isJndiLookupPresent = signatures.find((element) => element.path.includes(jndiLookupPath));
|
||||
return !!isJndiLookupPresent;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
}
|
||||
function exitWithError() {
|
||||
const err = new Error();
|
||||
err.code = 'VULNS';
|
||||
throw err;
|
||||
}
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
};
|
||||
;
|
||||
//# sourceMappingURL=989.index.js.map
|
||||
1
safekiso-server/node_modules/snyk/dist/cli/989.index.js.map
generated
vendored
Normal file
1
safekiso-server/node_modules/snyk/dist/cli/989.index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
19
safekiso-server/node_modules/snyk/dist/cli/args.d.ts
generated
vendored
Normal file
19
safekiso-server/node_modules/snyk/dist/cli/args.d.ts
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
/// <reference types="node" />
|
||||
/// <reference types="node" />
|
||||
/// <reference types="node" />
|
||||
import { MethodResult } from './commands/types';
|
||||
export declare interface Global extends NodeJS.Global {
|
||||
ignoreUnknownCA: boolean;
|
||||
}
|
||||
export type MethodArgs = Array<string | ArgsOptions>;
|
||||
export interface Args {
|
||||
command: string;
|
||||
method: (...args: MethodArgs) => Promise<MethodResult>;
|
||||
options: ArgsOptions;
|
||||
}
|
||||
export interface ArgsOptions {
|
||||
_doubleDashArgs: string[];
|
||||
_: MethodArgs;
|
||||
[key: string]: boolean | string | number | MethodArgs | string[];
|
||||
}
|
||||
export declare function args(rawArgv: string[]): Args;
|
||||
1
safekiso-server/node_modules/snyk/dist/cli/commands/about.d.ts
generated
vendored
Normal file
1
safekiso-server/node_modules/snyk/dist/cli/commands/about.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export default function about(): void;
|
||||
10
safekiso-server/node_modules/snyk/dist/cli/commands/apps/create-app.d.ts
generated
vendored
Normal file
10
safekiso-server/node_modules/snyk/dist/cli/commands/apps/create-app.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { ICreateAppRequest } from '../../../lib/apps';
|
||||
/**
|
||||
* Function to process the app creation request and
|
||||
* handle any errors that are request error and print
|
||||
* in a formatted string. It throws is error is unknown
|
||||
* or cannot be handled.
|
||||
* @param {ICreateAppRequest} data to create the app
|
||||
* @returns {String} response formatted string
|
||||
*/
|
||||
export declare function createApp(data: ICreateAppRequest): Promise<string | void>;
|
||||
2
safekiso-server/node_modules/snyk/dist/cli/commands/apps/index.d.ts
generated
vendored
Normal file
2
safekiso-server/node_modules/snyk/dist/cli/commands/apps/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import { MethodArgs } from '../../args';
|
||||
export default function apps(...args0: MethodArgs): Promise<string | undefined | any>;
|
||||
1
safekiso-server/node_modules/snyk/dist/cli/commands/auth/index.d.ts
generated
vendored
Normal file
1
safekiso-server/node_modules/snyk/dist/cli/commands/auth/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export default function auth(apiToken: string): Promise<string>;
|
||||
1
safekiso-server/node_modules/snyk/dist/cli/commands/auth/verify.d.ts
generated
vendored
Normal file
1
safekiso-server/node_modules/snyk/dist/cli/commands/auth/verify.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare function verifyAPI(api: any): Promise<unknown>;
|
||||
1
safekiso-server/node_modules/snyk/dist/cli/commands/config.d.ts
generated
vendored
Normal file
1
safekiso-server/node_modules/snyk/dist/cli/commands/config.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export default function config(method?: 'set' | 'get' | 'unset' | 'clear', ...args: string[]): Promise<string>;
|
||||
7
safekiso-server/node_modules/snyk/dist/cli/commands/describe.d.ts
generated
vendored
Normal file
7
safekiso-server/node_modules/snyk/dist/cli/commands/describe.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import { MethodArgs } from '../args';
|
||||
import { CustomError } from '../../lib/errors';
|
||||
export declare class FlagError extends CustomError {
|
||||
constructor(flag: string);
|
||||
}
|
||||
declare const _default: (...args: MethodArgs) => Promise<any>;
|
||||
export default _default;
|
||||
3
safekiso-server/node_modules/snyk/dist/cli/commands/fix/convert-legacy-test-result-to-new.d.ts
generated
vendored
Normal file
3
safekiso-server/node_modules/snyk/dist/cli/commands/fix/convert-legacy-test-result-to-new.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import { TestResult } from '../../../lib/ecosystems/types';
|
||||
import { TestResult as LegacyTestResult } from '../../../lib/snyk-test/legacy';
|
||||
export declare function convertLegacyTestResultToNew(testResult: LegacyTestResult): TestResult;
|
||||
3
safekiso-server/node_modules/snyk/dist/cli/commands/fix/convert-legacy-test-result-to-scan-result.d.ts
generated
vendored
Normal file
3
safekiso-server/node_modules/snyk/dist/cli/commands/fix/convert-legacy-test-result-to-scan-result.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import { ScanResult } from '../../../lib/ecosystems/types';
|
||||
import { TestResult } from '../../../lib/snyk-test/legacy';
|
||||
export declare function convertLegacyTestResultToScanResult(testResult: TestResult): ScanResult;
|
||||
4
safekiso-server/node_modules/snyk/dist/cli/commands/fix/convert-legacy-tests-results-to-fix-entities.d.ts
generated
vendored
Normal file
4
safekiso-server/node_modules/snyk/dist/cli/commands/fix/convert-legacy-tests-results-to-fix-entities.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import { TestResult } from '../../../lib/snyk-test/legacy';
|
||||
import { EntityToFix } from '@snyk/fix';
|
||||
import { Options, TestOptions } from '../../../lib/types';
|
||||
export declare function convertLegacyTestResultToFixEntities(testResults: (TestResult | TestResult[]) | Error, root: string, options: Partial<Options & TestOptions>): EntityToFix[];
|
||||
1
safekiso-server/node_modules/snyk/dist/cli/commands/fix/get-display-path.d.ts
generated
vendored
Normal file
1
safekiso-server/node_modules/snyk/dist/cli/commands/fix/get-display-path.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare function getDisplayPath(path: string): string;
|
||||
2
safekiso-server/node_modules/snyk/dist/cli/commands/fix/index.d.ts
generated
vendored
Normal file
2
safekiso-server/node_modules/snyk/dist/cli/commands/fix/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import { MethodArgs } from '../../args';
|
||||
export default function fix(...args: MethodArgs): Promise<string>;
|
||||
2
safekiso-server/node_modules/snyk/dist/cli/commands/fix/validate-fix-command-is-supported.d.ts
generated
vendored
Normal file
2
safekiso-server/node_modules/snyk/dist/cli/commands/fix/validate-fix-command-is-supported.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import { Options, TestOptions } from '../../../lib/types';
|
||||
export declare function validateFixCommandIsSupported(options: Options & TestOptions): Promise<boolean>;
|
||||
3
safekiso-server/node_modules/snyk/dist/cli/commands/help/index.d.ts
generated
vendored
Normal file
3
safekiso-server/node_modules/snyk/dist/cli/commands/help/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import { MethodArgs } from '../../args';
|
||||
export declare function findHelpFile(helpArgs: string[], helpFolderPath?: string): string;
|
||||
export default function help(...args: MethodArgs): Promise<string>;
|
||||
1
safekiso-server/node_modules/snyk/dist/cli/commands/help/markdown-renderer.d.ts
generated
vendored
Normal file
1
safekiso-server/node_modules/snyk/dist/cli/commands/help/markdown-renderer.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare function renderMarkdown(markdown: string): string;
|
||||
28
safekiso-server/node_modules/snyk/dist/cli/commands/help/reflow-text.d.ts
generated
vendored
Normal file
28
safekiso-server/node_modules/snyk/dist/cli/commands/help/reflow-text.d.ts
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
Code in this file is adapted from mikaelbr/marked-terminal
|
||||
https://github.com/mikaelbr/marked-terminal/blob/7501b8bb24a5ed52ec7d9114d4aeefa14f1bf5e6/index.js#L234-L330
|
||||
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2017 Mikael Brevik
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
export declare function reflowText(text: string, width: number): string;
|
||||
4
safekiso-server/node_modules/snyk/dist/cli/commands/ignore.d.ts
generated
vendored
Normal file
4
safekiso-server/node_modules/snyk/dist/cli/commands/ignore.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import { MethodResult } from './types';
|
||||
export default function ignore(options: any): Promise<MethodResult>;
|
||||
export declare function ignoreIssue(options: any): Promise<MethodResult>;
|
||||
export declare function excludeFilePathPattern(options: any): Promise<MethodResult>;
|
||||
20
safekiso-server/node_modules/snyk/dist/cli/commands/index.d.ts
generated
vendored
Normal file
20
safekiso-server/node_modules/snyk/dist/cli/commands/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
export = commands;
|
||||
declare const commands: {
|
||||
auth: (...args: any[]) => Promise<any>;
|
||||
config: (...args: any[]) => Promise<any>;
|
||||
'update-exclude-policy': (...args: any[]) => Promise<any>;
|
||||
describe: (...args: any[]) => Promise<any>;
|
||||
help: (...args: any[]) => Promise<any>;
|
||||
ignore: (...args: any[]) => Promise<any>;
|
||||
monitor: (...args: any[]) => Promise<any>;
|
||||
fix: (...args: any[]) => Promise<any>;
|
||||
policy: (...args: any[]) => Promise<any>;
|
||||
protect: (...args: any[]) => Promise<any>;
|
||||
test: (...args: any[]) => Promise<any>;
|
||||
version: (...args: any[]) => Promise<any>;
|
||||
about: (...args: any[]) => Promise<any>;
|
||||
wizard: (...args: any[]) => Promise<any>;
|
||||
woof: (...args: any[]) => Promise<any>;
|
||||
log4shell: (...args: any[]) => Promise<any>;
|
||||
apps: (...args: any[]) => Promise<any>;
|
||||
};
|
||||
12
safekiso-server/node_modules/snyk/dist/cli/commands/log4shell-hashes.d.ts
generated
vendored
Normal file
12
safekiso-server/node_modules/snyk/dist/cli/commands/log4shell-hashes.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* The content of this file is generated by a tool.
|
||||
* Don't edit it manually!
|
||||
* */
|
||||
export type FileSignatureDetails = {
|
||||
versions: string[];
|
||||
filename: string;
|
||||
};
|
||||
export type VulnerableSignatures = {
|
||||
[signature: string]: FileSignatureDetails;
|
||||
};
|
||||
export declare const vulnerableSignatures: VulnerableSignatures;
|
||||
2
safekiso-server/node_modules/snyk/dist/cli/commands/log4shell.d.ts
generated
vendored
Normal file
2
safekiso-server/node_modules/snyk/dist/cli/commands/log4shell.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import { MethodArgs } from '../args';
|
||||
export default function log4shell(...args: MethodArgs): Promise<void>;
|
||||
17
safekiso-server/node_modules/snyk/dist/cli/commands/monitor/index.d.ts
generated
vendored
Normal file
17
safekiso-server/node_modules/snyk/dist/cli/commands/monitor/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
import { ProjectAttributes, Tag } from '../../../lib/types';
|
||||
import { MethodArgs } from '../../args';
|
||||
export default function monitor(...args0: MethodArgs): Promise<any>;
|
||||
export declare function validateProjectAttributes(options: any): void;
|
||||
export declare function generateProjectAttributes(options: any): ProjectAttributes;
|
||||
/**
|
||||
* Parse CLI --tags options into an internal data structure.
|
||||
*
|
||||
* If this returns undefined, it means "do not touch the existing tags on the project".
|
||||
*
|
||||
* Anything else means "replace existing tags on the project with this list" even if empty.
|
||||
*
|
||||
* @param options CLI options
|
||||
* @returns List of parsed tags or undefined if they are to be left untouched.
|
||||
*/
|
||||
export declare function generateTags(options: any): Tag[] | undefined;
|
||||
export declare function validateTags(options: any): void;
|
||||
2
safekiso-server/node_modules/snyk/dist/cli/commands/monitor/process-json-monitor.d.ts
generated
vendored
Normal file
2
safekiso-server/node_modules/snyk/dist/cli/commands/monitor/process-json-monitor.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import { GoodResult, BadResult } from './types';
|
||||
export declare function processJsonMonitorResponse(results: Array<GoodResult | BadResult>): string;
|
||||
12
safekiso-server/node_modules/snyk/dist/cli/commands/monitor/types.d.ts
generated
vendored
Normal file
12
safekiso-server/node_modules/snyk/dist/cli/commands/monitor/types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import { MonitorError } from '../../../lib/errors';
|
||||
export interface GoodResult {
|
||||
ok: true;
|
||||
data: string;
|
||||
path: string;
|
||||
projectName?: string;
|
||||
}
|
||||
export interface BadResult {
|
||||
ok: false;
|
||||
data: MonitorError;
|
||||
path: string;
|
||||
}
|
||||
1
safekiso-server/node_modules/snyk/dist/cli/commands/policy.d.ts
generated
vendored
Normal file
1
safekiso-server/node_modules/snyk/dist/cli/commands/policy.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export default function displayPolicy(path?: string): Promise<string>;
|
||||
5
safekiso-server/node_modules/snyk/dist/cli/commands/process-command-args.d.ts
generated
vendored
Normal file
5
safekiso-server/node_modules/snyk/dist/cli/commands/process-command-args.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import { Options } from '../../lib/types';
|
||||
export declare function processCommandArgs<CommandOptions>(...args: any[]): {
|
||||
paths: string[];
|
||||
options: Options & CommandOptions;
|
||||
};
|
||||
1
safekiso-server/node_modules/snyk/dist/cli/commands/protect/index.d.ts
generated
vendored
Normal file
1
safekiso-server/node_modules/snyk/dist/cli/commands/protect/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export default function protectFunc(): void;
|
||||
1
safekiso-server/node_modules/snyk/dist/cli/commands/protect/wizard.d.ts
generated
vendored
Normal file
1
safekiso-server/node_modules/snyk/dist/cli/commands/protect/wizard.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export default function wizard(): void;
|
||||
1
safekiso-server/node_modules/snyk/dist/cli/commands/test/format-test-error.d.ts
generated
vendored
Normal file
1
safekiso-server/node_modules/snyk/dist/cli/commands/test/format-test-error.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare function formatTestError(error: any): any;
|
||||
5
safekiso-server/node_modules/snyk/dist/cli/commands/test/iac/index.d.ts
generated
vendored
Normal file
5
safekiso-server/node_modules/snyk/dist/cli/commands/test/iac/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import { MethodArgs } from '../../../args';
|
||||
import { TestCommandResult } from '../../types';
|
||||
import { IaCTestFlags } from './local-execution/types';
|
||||
export default function (...args: MethodArgs): Promise<TestCommandResult>;
|
||||
export declare function getFlag(options: IaCTestFlags, flag: string): string | undefined;
|
||||
8
safekiso-server/node_modules/snyk/dist/cli/commands/test/iac/local-execution/analytics.d.ts
generated
vendored
Normal file
8
safekiso-server/node_modules/snyk/dist/cli/commands/test/iac/local-execution/analytics.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import { FormattedResult, PerformanceAnalyticsKey, RulesOrigin } from './types';
|
||||
import { DescribeOptions, DriftAnalysis } from '../../../../../lib/iac/types';
|
||||
export declare function addIacAnalytics(formattedResults: FormattedResult[], opts: {
|
||||
ignoredIssuesCount: number;
|
||||
rulesOrigin: RulesOrigin;
|
||||
}): void;
|
||||
export declare const performanceAnalyticsObject: Record<PerformanceAnalyticsKey, number | null>;
|
||||
export declare function addIacDriftAnalytics(analysis: DriftAnalysis, options: DescribeOptions): void;
|
||||
45
safekiso-server/node_modules/snyk/dist/cli/commands/test/iac/local-execution/assert-iac-options-flag.d.ts
generated
vendored
Normal file
45
safekiso-server/node_modules/snyk/dist/cli/commands/test/iac/local-execution/assert-iac-options-flag.d.ts
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
import { CustomError } from '../../../../../lib/errors';
|
||||
import { IacOrgSettings } from './types';
|
||||
import { Options, TestOptions } from '../../../../../lib/types';
|
||||
export declare class FlagError extends CustomError {
|
||||
constructor(key: string);
|
||||
}
|
||||
export declare class IntegratedFlagError extends CustomError {
|
||||
constructor(key: string, org: string);
|
||||
}
|
||||
export declare class FeatureFlagError extends CustomError {
|
||||
constructor(key: string, featureFlag: string, hasSnykPreview?: boolean);
|
||||
}
|
||||
export declare class FlagValueError extends CustomError {
|
||||
constructor(key: string, value: string, supportedValues: string);
|
||||
}
|
||||
export declare class UnsupportedEntitlementFlagError extends CustomError {
|
||||
constructor(key: string, entitlementName: string);
|
||||
}
|
||||
export declare class UnsupportedEntitlementCommandError extends CustomError {
|
||||
constructor(key: string, entitlementName: string);
|
||||
}
|
||||
/**
|
||||
* Validates the command line flags passed to the snyk iac test
|
||||
* command. The current argument parsing is very permissive and
|
||||
* allows unknown flags to be provided without validation.
|
||||
*
|
||||
* For snyk iac we need to explicitly validate the flags to avoid
|
||||
* misconfigurations and typos. For example, if the --experimental
|
||||
* flag were to be misspelled we would end up sending the client
|
||||
* data to our backend rather than running it locally as intended.
|
||||
* @param argv command line args passed to the process
|
||||
*/
|
||||
export declare function assertIaCOptionsFlags(argv: string[]): void;
|
||||
/**
|
||||
* Check that the flags used for the v1 flow do not contain any flag that are
|
||||
* only usable with the new IaC+ flow
|
||||
* @param settings organisation settings, used to get the org name
|
||||
* @param argv command line args
|
||||
*/
|
||||
export declare function assertIntegratedIaCOnlyOptions(settings: IacOrgSettings, argv: string[]): void;
|
||||
export declare function assertTerraformPlanModes(scanModeArgValue: string): void;
|
||||
export declare function isIacShareResultsOptions(options: Options & TestOptions): boolean | undefined;
|
||||
export declare class InvalidArgumentError extends CustomError {
|
||||
constructor(key: string);
|
||||
}
|
||||
22
safekiso-server/node_modules/snyk/dist/cli/commands/test/iac/local-execution/directory-loader.d.ts
generated
vendored
Normal file
22
safekiso-server/node_modules/snyk/dist/cli/commands/test/iac/local-execution/directory-loader.d.ts
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Gets all nested directories for the path that we ran a scan.
|
||||
* @param pathToScan - the path to scan provided by the user
|
||||
* @param maxDepth? - An optional `maxDepth` argument can be provided to limit how deep in the file tree the search will go.
|
||||
* @returns {string[]} An array with all the non-empty nested directories in this path
|
||||
*/
|
||||
export declare function getAllDirectoriesForPath(pathToScan: string, maxDepth?: number): string[];
|
||||
/**
|
||||
* Gets all file paths for the specific directory
|
||||
* @param pathToScan - the path to scan provided by the user
|
||||
* @param currentDirectory - the directory which we want to return files for
|
||||
* @returns {string[]} An array with all the Terraform filePaths for this directory
|
||||
*/
|
||||
export declare function getFilesForDirectory(pathToScan: string, currentDirectory: string): string[];
|
||||
/**
|
||||
* Iterates through the makeFileAndDirectoryGenerator function and gets all the Terraform files in the specified directory
|
||||
* @param pathToScan - the pathToScan to scan provided by the user
|
||||
* @returns {Generator<string>} - a generator which holds all the filepaths
|
||||
*/
|
||||
export declare function getFilesForDirectoryGenerator(pathToScan: string): Generator<string>;
|
||||
export declare const shouldBeParsed: (pathToScan: string) => boolean;
|
||||
export declare const getFileType: (pathToScan: string) => string;
|
||||
1
safekiso-server/node_modules/snyk/dist/cli/commands/test/iac/local-execution/error-utils.d.ts
generated
vendored
Normal file
1
safekiso-server/node_modules/snyk/dist/cli/commands/test/iac/local-execution/error-utils.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare function getErrorStringCode(code: number): string;
|
||||
11
safekiso-server/node_modules/snyk/dist/cli/commands/test/iac/local-execution/file-loader.d.ts
generated
vendored
Normal file
11
safekiso-server/node_modules/snyk/dist/cli/commands/test/iac/local-execution/file-loader.d.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import { IacFileData } from './types';
|
||||
import { CustomError } from '../../../../../lib/errors';
|
||||
export declare function loadContentForFiles(filePaths: string[]): Promise<IacFileData[]>;
|
||||
export declare function tryLoadFileData(pathToScan: string): Promise<IacFileData>;
|
||||
export declare class NoFilesToScanError extends CustomError {
|
||||
constructor(message?: string);
|
||||
}
|
||||
export declare class FailedToLoadFileError extends CustomError {
|
||||
filename: string;
|
||||
constructor(filename: string);
|
||||
}
|
||||
9
safekiso-server/node_modules/snyk/dist/cli/commands/test/iac/local-execution/file-parser.d.ts
generated
vendored
Normal file
9
safekiso-server/node_modules/snyk/dist/cli/commands/test/iac/local-execution/file-parser.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import { IacFileData, IacFileParsed, IaCTestFlags, ParsingResults } from './types';
|
||||
import { CustomError } from '../../../../../lib/errors';
|
||||
export declare function parseFiles(filesData: IacFileData[], options?: IaCTestFlags): Promise<ParsingResults>;
|
||||
export declare function parseNonTerraformFiles(filesData: IacFileData[], options: IaCTestFlags): ParsingResults;
|
||||
export declare function parseTerraformFiles(filesData: IacFileData[]): ParsingResults;
|
||||
export declare function tryParseIacFile(fileData: IacFileData, options?: IaCTestFlags): IacFileParsed[];
|
||||
export declare class UnsupportedFileTypeError extends CustomError {
|
||||
constructor(fileType: string);
|
||||
}
|
||||
18
safekiso-server/node_modules/snyk/dist/cli/commands/test/iac/local-execution/file-scanner.d.ts
generated
vendored
Normal file
18
safekiso-server/node_modules/snyk/dist/cli/commands/test/iac/local-execution/file-scanner.d.ts
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
import { IacFileParsed, IacFileScanResult } from './types';
|
||||
import { CustomError } from '../../../../../lib/errors';
|
||||
import { IacFileInDirectory } from '../../../../../lib/types';
|
||||
export declare function scanFiles(parsedFiles: Array<IacFileParsed>): Promise<{
|
||||
scannedFiles: IacFileScanResult[];
|
||||
failedScans: IacFileInDirectory[];
|
||||
}>;
|
||||
export declare function validateResultFromCustomRules(result: IacFileScanResult): {
|
||||
validatedResult: IacFileScanResult;
|
||||
invalidIssues: IacFileInDirectory[];
|
||||
};
|
||||
export declare function clearPolicyEngineCache(): void;
|
||||
export declare class FailedToBuildPolicyEngine extends CustomError {
|
||||
constructor(message?: string);
|
||||
}
|
||||
export declare class FailedToExecutePolicyEngine extends CustomError {
|
||||
constructor(message?: string);
|
||||
}
|
||||
12
safekiso-server/node_modules/snyk/dist/cli/commands/test/iac/local-execution/file-utils.d.ts
generated
vendored
Normal file
12
safekiso-server/node_modules/snyk/dist/cli/commands/test/iac/local-execution/file-utils.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
/// <reference types="node" />
|
||||
export declare function createIacDir(): void;
|
||||
export declare function extractBundle(response: NodeJS.ReadableStream): Promise<void>;
|
||||
export declare function isValidBundle(wasmPath: string, dataPath: string): boolean;
|
||||
export declare function computeCustomRulesBundleChecksum(): string | undefined;
|
||||
/**
|
||||
* makeFileAndDirectoryGenerator is a generator function that helps walking the directory and file structure of this pathToScan
|
||||
* @param root
|
||||
* @param maxDepth? - An optional `maxDepth` argument can be provided to limit how deep in the file tree the search will go.
|
||||
* @returns {Generator<object>} - a generator which yields an object with directories or paths for the path to scan
|
||||
*/
|
||||
export declare function makeFileAndDirectoryGenerator(root?: string, maxDepth?: number): Generator<any, void, any>;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user