MCPcopy Create free account
hub / github.com/ShipSecAI/studio / execute

Function execute

worker/src/components/security/prowler-scan.ts:443–798  ·  view source on GitHub ↗
({ inputs, params }, context)

Source from the content-addressed store, hash-verified

441 ],
442 },
443 async execute({ inputs, params }, context) {
444 const parsedInputs = inputSchema.parse(inputs);
445 const parsedParams = parameterSchema.parse(params);
446
447 // Helper: split custom CLI flags honoring simple quotes
448 const splitArgs = (input: string): string[] => {
449 const args: string[] = [];
450 let current = '';
451 let quote: '"' | "'" | null = null;
452 let escape = false;
453 for (const ch of input) {
454 if (escape) {
455 current += ch;
456 escape = false;
457 continue;
458 }
459 if (ch === '\\') {
460 escape = true;
461 continue;
462 }
463 if (quote) {
464 if (ch === quote) {
465 quote = null;
466 } else {
467 current += ch;
468 }
469 continue;
470 }
471 if (ch === '"' || ch === "'") {
472 quote = ch as '"' | "'";
473 continue;
474 }
475 if (/\s/.test(ch)) {
476 if (current.length > 0) {
477 args.push(current);
478 current = '';
479 }
480 continue;
481 }
482 current += ch;
483 }
484 if (current.length > 0) args.push(current);
485 return args;
486 };
487 const parsedRegions = parsedInputs.regions
488 .split(',')
489 .map((region) => region.trim())
490 .filter((region) => region.length > 0);
491 const regions = parsedRegions.length > 0 ? parsedRegions : ['us-east-1'];
492
493 const selectedFlags = new Set<RecommendedFlagId>(
494 parsedParams.recommendedFlags ?? defaultSelectedFlagIds,
495 );
496 const resolvedFlagArgs = Array.from(selectedFlags).flatMap(
497 (flagId) => recommendedFlagMap.get(flagId) ?? [],
498 );
499
500 // Validate creds when running AWS scans

Callers

nothing calls this directly

Calls 15

getVolumeNameMethod · 0.95
initializeMethod · 0.95
getVolumeConfigMethod · 0.95
readFilesMethod · 0.95
cleanupMethod · 0.95
generateFindingHashFunction · 0.90
splitArgsFunction · 0.85
setVolumeOwnershipFunction · 0.85
listVolumeFilesFunction · 0.85
normaliseFindingsFunction · 0.85
buildScanIdFunction · 0.85
mapToAnalyticsSeverityFunction · 0.85

Tested by

no test coverage detected