Skip to content

Commit

Permalink
add shodan test script
Browse files Browse the repository at this point in the history
  • Loading branch information
aloftus23 committed Oct 11, 2023
1 parent f1ad663 commit 4d5b1ab
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
10 changes: 8 additions & 2 deletions backend/src/tasks/scanExecution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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!,
Expand Down
11 changes: 11 additions & 0 deletions backend/worker/shodan.sh
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 4d5b1ab

Please sign in to comment.