diff --git a/backend/src/tasks/scanExecution.ts b/backend/src/tasks/scanExecution.ts index 1eec806bc..f6c1eb881 100644 --- a/backend/src/tasks/scanExecution.ts +++ b/backend/src/tasks/scanExecution.ts @@ -8,10 +8,16 @@ export const handler: Handler = async (event) => { try { // Get the SQS record and message body const sqsRecord: SQSRecord = event.Records[0]; - const commandOptions: string = sqsRecord.body; + const body: string = sqsRecord.body; - console.log(commandOptions); + console.log(body); + let commandOptions; + if (body === 'SHODAN') { + commandOptions = './worker/shodan.sh'; + } else { + commandOptions = body; + } // Run command in queue message in Fargate const params: AWS.ECS.RunTaskRequest = { cluster: process.env.FARGATE_CLUSTER_NAME!, diff --git a/backend/worker/shodan.sh b/backend/worker/shodan.sh new file mode 100644 index 000000000..d73535fa8 --- /dev/null +++ b/backend/worker/shodan.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +set -e + +cd /app/pe-reports + +echo "Starting Shodan" + +pe-source shodan --orgs=DHS --soc_med_included + +echo "Done" \ No newline at end of file