From 89a8d9af2e17bc1c2cbc8c46fd0fe95ccf4feb7a Mon Sep 17 00:00:00 2001 From: aloftus23 Date: Thu, 7 Nov 2024 14:24:58 -0500 Subject: [PATCH] Add whoisxml api key variable --- backend/serverless.yml | 4 ++-- backend/src/tasks/scanExecution.ts | 3 ++- backend/worker/generate_config.sh | 2 +- dev.env.example | 2 ++ infrastructure/pe_worker.tf | 6 +++++- infrastructure/stage.tfvars | 1 + infrastructure/vars.tf | 6 ++++++ infrastructure/worker.tf | 3 +++ 8 files changed, 22 insertions(+), 5 deletions(-) diff --git a/backend/serverless.yml b/backend/serverless.yml index dd7e1f41..0855d504 100644 --- a/backend/serverless.yml +++ b/backend/serverless.yml @@ -147,10 +147,10 @@ resources: VisibilityTimeout: 18000 # 5 hours MaximumMessageSize: 262144 # 256 KB MessageRetentionPeriod: 604800 # 7 days - ASMQueue: + ASMSyncQueue: Type: AWS::SQS::Queue Properties: - QueueName: ${self:provider.stage}-asm-queue + QueueName: ${self:provider.stage}-asmSync-queue VisibilityTimeout: 18000 # 5 hours MaximumMessageSize: 262144 # 256 KB MessageRetentionPeriod: 604800 # 7 days diff --git a/backend/src/tasks/scanExecution.ts b/backend/src/tasks/scanExecution.ts index d1dff72d..addc37b9 100644 --- a/backend/src/tasks/scanExecution.ts +++ b/backend/src/tasks/scanExecution.ts @@ -159,7 +159,8 @@ async function startLocalContainers( `SERVICE_TYPE=${scanType}`, `PE_API_URL=${process.env.PE_API_URL}`, `PE_API_KEY=${process.env.PE_API_KEY}`, - `CF_API_KEY=${process.env.CF_API_KEY}` + `CF_API_KEY=${process.env.CF_API_KEY}`, + `WHOIS_XML_KEY=${process.env.WHOIS_XML_KEY}` ] } as any); await container.start(); diff --git a/backend/worker/generate_config.sh b/backend/worker/generate_config.sh index 2057aa68..a9912c63 100755 --- a/backend/worker/generate_config.sh +++ b/backend/worker/generate_config.sh @@ -25,7 +25,7 @@ client_id=${SIXGILL_CLIENT_ID} client_secret=${SIXGILL_CLIENT_SECRET} [whoisxml] -key= +key=${WHOIS_XML_KEY} [intelx] api_key=${INTELX_API_KEY} diff --git a/dev.env.example b/dev.env.example index e453e7af..509761df 100644 --- a/dev.env.example +++ b/dev.env.example @@ -108,3 +108,5 @@ PE_SHODAN_API_KEYS= PE_FARGATE_CLUSTER_NAME=pe-staging-worker PE_FARGATE_TASK_DEFINITION_NAME=pe-staging-worker + +WHOIS_XML_KEY=change_me diff --git a/infrastructure/pe_worker.tf b/infrastructure/pe_worker.tf index 3d34ca3f..cac486a5 100644 --- a/infrastructure/pe_worker.tf +++ b/infrastructure/pe_worker.tf @@ -160,7 +160,11 @@ resource "aws_ecs_task_definition" "pe_worker" { { "name": "ELASTICSEARCH_ENDPOINT", "valueFrom": "${aws_ssm_parameter.es_endpoint.arn}" - } + }, + { + "name": "WHOIS_XML_KEY", + "valueFrom": "${aws_ssm_parameter.whoisxml_api_key.arn}" + }, ] } ] diff --git a/infrastructure/stage.tfvars b/infrastructure/stage.tfvars index 10c71f1c..eba77a4a 100644 --- a/infrastructure/stage.tfvars +++ b/infrastructure/stage.tfvars @@ -58,6 +58,7 @@ ssm_lg_api_key = "/crossfeed/staging/LG_API_KEY" ssm_lg_workspace_name = "/crossfeed/staging/LG_WORKSPACE_NAME" ssm_pe_api_key = "/crossfeed/staging/PE_API_KEY" ssm_cf_api_key = "/crossfeed/staging/CF_API_KEY" +ssm_whoisxml_api_key = "/crossfeed/staging/WHOIS_XML_KEY" db_group_name = "crossfeed-staging-db-group" worker_ecs_repository_name = "crossfeed-staging-worker" worker_ecs_cluster_name = "crossfeed-staging-worker" diff --git a/infrastructure/vars.tf b/infrastructure/vars.tf index 53232f6d..6b48cf3c 100644 --- a/infrastructure/vars.tf +++ b/infrastructure/vars.tf @@ -327,6 +327,12 @@ variable "ssm_xpanse_api_key" { default = "/crossfeed/staging/XPANSE_API_KEY" } +variable "ssm_whoisxml_api_key" { + description = "ssm_whoisxml_api_key" + type = string + default = "/crossfeed/staging/WHOIS_XML_KEY" +} + variable "ssm_xpanse_auth_id" { description = "ssm_xpanse_auth_id" type = string diff --git a/infrastructure/worker.tf b/infrastructure/worker.tf index 6108cba2..a41e2402 100644 --- a/infrastructure/worker.tf +++ b/infrastructure/worker.tf @@ -87,6 +87,7 @@ resource "aws_iam_role_policy" "worker_task_execution_role_policy" { "${data.aws_ssm_parameter.intelx_api_key.arn}", "${data.aws_ssm_parameter.xpanse_api_key.arn}", "${data.aws_ssm_parameter.xpanse_auth_id.arn}", + "${data.aws_ssm_parameter.whoisxml_api_key.arn}", "${data.aws_ssm_parameter.sixgill_client_secret.arn}", "${data.aws_ssm_parameter.lg_api_key.arn}", "${data.aws_ssm_parameter.lg_workspace_name.arn}", @@ -386,6 +387,8 @@ data "aws_ssm_parameter" "intelx_api_key" { name = var.ssm_intelx_api_key } data "aws_ssm_parameter" "xpanse_api_key" { name = var.ssm_xpanse_api_key } +data "aws_ssm_parameter" "whoisxml_api_key" { name = var.ssm_whoisxml_api_key } + data "aws_ssm_parameter" "xpanse_auth_id" { name = var.ssm_xpanse_auth_id } data "aws_ssm_parameter" "sixgill_client_secret" { name = var.ssm_sixgill_client_secret }