Skip to content

Commit

Permalink
Merge pull request #25 from SPHTech-Platform/fix/error-when-disabled
Browse files Browse the repository at this point in the history
Fix error when SH integration is disabled
  • Loading branch information
smoneyan authored May 29, 2023
2 parents bf9cd9f + 22023f8 commit c54d027
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ data "aws_iam_policy_document" "aqua_cspm_secret" {
data "aws_iam_policy_document" "aqua_cspm_control_tower_kms_key" {
#checkov:skip=CKV_AWS_109
#checkov:skip=CKV_AWS_111
#checkov:skip=CKV_AWS_356
statement {
sid = "Allow administration of the key"

Expand Down Expand Up @@ -125,6 +126,7 @@ data "aws_iam_policy_document" "aqua_cspm_lambda" {
}

data "aws_iam_policy_document" "aqua_cspm_supplemental" {
#checkov:skip=CKV_AWS_356
statement {
effect = "Allow"

Expand Down Expand Up @@ -406,6 +408,7 @@ data "aws_iam_policy_document" "aquahub_sechub_trust" {
data "aws_iam_policy_document" "aquasec_importfindings" {
#checkov:skip=CKV_AWS_111
#checkov:skip=CKV_AWS_108
#checkov:skip=CKV_AWS_356
statement {
actions = [
"securityhub:BatchImportFindings"
Expand Down
2 changes: 1 addition & 1 deletion locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ locals {
secret_name = "/aquacspm/secret-cspm"

external_id = jsondecode(aws_lambda_invocation.external_id.result)["status"] == "FAILED" ? jsondecode(aws_lambda_invocation.external_id.result)["message"] : jsondecode(aws_lambda_invocation.external_id.result)["ExternalId"]
sechub_external_id = jsondecode(aws_lambda_invocation.sechub_integration_external_id[0].result)["status"] == "FAILED" ? jsondecode(aws_lambda_invocation.sechub_integration_external_id[0].result)["message"] : jsondecode(aws_lambda_invocation.sechub_integration_external_id[0].result)["ExternalId"]
sechub_external_id = local.enable_security_hub_integration ? (jsondecode(aws_lambda_invocation.sechub_integration_external_id[0].result)["status"] == "FAILED" ? jsondecode(aws_lambda_invocation.sechub_integration_external_id[0].result)["message"] : jsondecode(aws_lambda_invocation.sechub_integration_external_id[0].result)["ExternalId"]) : null

aquasec_account_id = "057012691312"
# public_ip = "13.215.18.141/32"
Expand Down

0 comments on commit c54d027

Please sign in to comment.