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

Function execute

worker/src/components/security/dnsx.ts:522–1095  ·  view source on GitHub ↗
({ inputs, params }, context)

Source from the content-addressed store, hash-verified

520 deprecated: false,
521 },
522 async execute({ inputs, params }, context) {
523 const parsedParams = parameterSchema.parse(params);
524 const { domains } = inputs;
525 const {
526 recordTypes,
527 resolvers,
528 retryCount,
529 rateLimit,
530 outputMode,
531 threads,
532 includeResponses,
533 responsesOnly,
534 statusCodeFilter,
535 showCdn,
536 showAsn,
537 includeStats,
538 verbose,
539 includeRawDns,
540 omitRawInJson,
541 wildcardThreshold,
542 wildcardDomain,
543 proxy,
544 customFlags,
545 } = parsedParams;
546
547 const trimmedStatusCodeFilter =
548 typeof statusCodeFilter === 'string' && statusCodeFilter.length > 0
549 ? statusCodeFilter
550 : undefined;
551 const trimmedWildcardDomain =
552 typeof wildcardDomain === 'string' && wildcardDomain.length > 0 ? wildcardDomain : undefined;
553 const trimmedProxy = typeof proxy === 'string' && proxy.length > 0 ? proxy : undefined;
554 const customFlagArgs =
555 typeof customFlags === 'string' && customFlags.length > 0 ? splitCliArgs(customFlags) : [];
556
557 const normalisedDomains = domains
558 .map((domain) => domain.trim())
559 .filter((domain) => domain.length > 0);
560 const domainCount = normalisedDomains.length;
561
562 const resolverList = resolvers
563 .map((resolver) => resolver.trim())
564 .filter((resolver) => resolver.length > 0);
565
566 const ensureUnique = (values: string[]) =>
567 Array.from(new Set(values.filter((value) => value && value.length > 0)));
568
569 const requestedRecordTypes = ensureUnique(recordTypes);
570 const requestedResolvers = ensureUnique(resolverList);
571
572 if (domainCount === 0) {
573 context.logger.info('[DNSX] Skipping dnsx execution because no domains were provided.');
574 return outputSchema.parse({
575 dnsRecords: [],
576 results: [],
577 rawOutput: '',
578 domainCount: 0,
579 recordCount: 0,

Callers

nothing calls this directly

Calls 14

initializeMethod · 0.95
getVolumeConfigMethod · 0.95
cleanupMethod · 0.95
runComponentWithRunnerFunction · 0.90
generateFindingHashFunction · 0.90
ensureUniqueFunction · 0.85
buildDnsxArgsFunction · 0.85
buildSilentOutputFunction · 0.85
buildOutputFunction · 0.85
parseMethod · 0.80
infoMethod · 0.80
errorMethod · 0.80

Tested by

no test coverage detected