Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding ability to send multiple workspaces to the Azure sentinel role #325

Merged
merged 4 commits into from
Dec 17, 2024

Conversation

sylviamclaughlin
Copy link
Contributor

@sylviamclaughlin sylviamclaughlin commented Dec 17, 2024

Summary | Résumé

Fixes #324

Allows us to pass in multiple log analytics workspace ids to the Azure sentinel role. This is a temporary issue that we need to deal with since we are using 2 log workspaces to recreate the infrastructure in the new landing zone for the Sentinel connectors . Once we have recreated everything, we can move only to one workspace id.

I also removed the delay for the SQS queue since it was not necessary and updated the polling delay as well so in theory that should speed up the ingestion delay in Sentinel.

Copy link

Plan for org_account/main

✅   Terraform Init: success
✅   Terraform Validate: success
✅   Terraform Format: success
✅   Terraform Plan: success
✅   Conftest: success

Plan: 0 to add, 2 to change, 0 to destroy
Show summary
CHANGE NAME
update aws_iam_role.azure_sentinel
aws_sqs_queue.cloudtrail_sqs_queue
Show plan
Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # aws_iam_role.azure_sentinel will be updated in-place
  ~ resource "aws_iam_role" "azure_sentinel" {
      ~ assume_role_policy    = jsonencode(
          ~ {
              ~ Statement = [
                  ~ {
                      ~ Condition = {
                          - "ForAnyValue:StringEquals" = {
                              - "sts:ExternalId" = [
                                  - "90ad7e41-b287-4d79-8c21-01f328f577b9",
                                  - "3774a838-caa6-4c0b-8b42-edabbc9d8fda",
                                ]
                            }
                          + StringEquals               = {
                              + "sts:ExternalId" = [
                                  + "90ad7e41-b287-4d79-8c21-01f328f577b9",
                                  + "3774a838-caa6-4c0b-8b42-edabbc9d8fda",
                                ]
                            }
                        }
                        # (4 unchanged attributes hidden)
                    },
                ]
                # (1 unchanged attribute hidden)
            }
        )
        id                    = "AzureSentinelRole"
        name                  = "AzureSentinelRole"
        tags                  = {}
        # (10 unchanged attributes hidden)
    }

  # aws_sqs_queue.cloudtrail_sqs_queue will be updated in-place
  ~ resource "aws_sqs_queue" "cloudtrail_sqs_queue" {
      ~ delay_seconds                     = 90 -> 0
        id                                = "https://sqs.ca-central-1.amazonaws.com/274536870005/azure-sentinel-cloudtrail-queue"
        name                              = "azure-sentinel-cloudtrail-queue"
      ~ receive_wait_time_seconds         = 10 -> 5
        tags                              = {}
        # (11 unchanged attributes hidden)
    }

Plan: 0 to add, 2 to change, 0 to destroy.

Warning: Argument is deprecated

  with module.publishing_bucket.aws_s3_bucket.this,
  on .terraform/modules/publishing_bucket/S3/main.tf line 8, in resource "aws_s3_bucket" "this":
   8: resource "aws_s3_bucket" "this" {

Use the aws_s3_bucket_logging resource instead

(and 9 more similar warnings elsewhere)

─────────────────────────────────────────────────────────────────────────────

Saved the plan to: plan.tfplan

To perform exactly these actions, run the following command to apply:
    terraform apply "plan.tfplan"
Show Conftest results
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_event_rule.cds_sentinel_securityhub_rule"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_policy.ct_list_controls"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_role.azure_sentinel"]
WARN - plan.json - main - Missing Common Tags: ["aws_kms_key.cds_sentinel_guard_duty_key"]
WARN - plan.json - main - Missing Common Tags: ["aws_sns_topic.critical"]
WARN - plan.json - main - Missing Common Tags: ["aws_sns_topic.warning"]
WARN - plan.json - main - Missing Common Tags: ["aws_sqs_queue.cloudtrail_sqs_queue"]
WARN - plan.json - main - Missing Common Tags: ["module.alarm_actions.aws_cloudwatch_metric_alarm.alarm_failure[\"Ops1\"]"]
WARN - plan.json - main - Missing Common Tags: ["module.alarm_actions.aws_cloudwatch_metric_alarm.alarm_failure[\"Ops2\"]"]
WARN - plan.json - main - Missing Common Tags: ["module.alarm_actions.aws_cloudwatch_metric_alarm.alarm_success[\"Ops1\"]"]
WARN - plan.json - main - Missing Common Tags: ["module.alarm_actions.aws_cloudwatch_metric_alarm.alarm_success[\"Ops2\"]"]
WARN - plan.json - main - Missing Common Tags: ["module.gd_aft_management_detector.aws_guardduty_detector.ca_central_1"]
WARN - plan.json - main - Missing Common Tags: ["module.gd_aft_management_detector.aws_guardduty_detector.us_east_1"]
WARN - plan.json - main - Missing Common Tags: ["module.gd_aft_management_detector.aws_guardduty_detector.us_west_2"]
WARN - plan.json - main - Missing Common Tags: ["module.gd_audit_detector.aws_guardduty_detector.ca_central_1"]
WARN - plan.json - main - Missing Common Tags: ["module.gd_audit_detector.aws_guardduty_detector.us_east_1"]
WARN - plan.json - main - Missing Common Tags: ["module.gd_audit_detector.aws_guardduty_detector.us_west_2"]
WARN - plan.json - main - Missing Common Tags: ["module.gd_log_archive_detector.aws_guardduty_detector.ca_central_1"]
WARN - plan.json - main - Missing Common Tags:...

@sylviamclaughlin sylviamclaughlin requested a review from a team December 17, 2024 01:13
Copy link
Member

@wanpengyang wanpengyang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@sylviamclaughlin sylviamclaughlin merged commit 4218e6a into main Dec 17, 2024
16 checks passed
@sylviamclaughlin sylviamclaughlin deleted the fix/pass_another_sentinel_workspace branch December 17, 2024 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update lw_customer_id to an array of strings instead of single value
3 participants