cds-snc / cloud-based-sensor

Infrastructure configuration to manage CCCS's Cloud Based Sensor in AWS accounts
https://cyber.gc.ca/en/host-based-sensors
MIT License
0 stars 0 forks source link

Deleting alarms since they are no longer needed #368

Closed sylviamclaughlin closed 3 months ago

sylviamclaughlin commented 3 months ago

Summary | Résumé

Deleting the alarms since they were for CBS v1.0 and are no longer needed.

github-actions[bot] commented 3 months ago

Central Alarms

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

⚠️   Warning: resources will be destroyed by this change!

Plan: 0 to add, 0 to change, 6 to destroy
Show summary | CHANGE | NAME | |--------|-----------------------------------------------------------| | delete | `aws_cloudwatch_log_metric_filter.transport_lambda_error` | | | `aws_cloudwatch_metric_alarm.no_transport_lambda_logs` | | | `aws_cloudwatch_metric_alarm.transport_lambda_error` | | | `aws_kms_key.sns_cloudwatch` | | | `aws_sns_topic.cloudwatch_alarm` | | | `aws_sns_topic_subscription.cloudwatch_alarm` |
Show plan ```terraform Resource actions are indicated with the following symbols: - destroy Terraform will perform the following actions: # aws_cloudwatch_log_metric_filter.transport_lambda_error will be destroyed # (because aws_cloudwatch_log_metric_filter.transport_lambda_error is not in configuration) - resource "aws_cloudwatch_log_metric_filter" "transport_lambda_error" { - id = "TransportLambdaErrorLogged" -> null - log_group_name = "/aws/lambda/CbsTransportLambda" -> null - name = "TransportLambdaErrorLogged" -> null - pattern = "ERROR" -> null - metric_transformation { - dimensions = {} -> null - name = "TransportLambdaErrorLogged" -> null - namespace = "CloudBasedSensor" -> null - unit = "None" -> null - value = "1" -> null } } # aws_cloudwatch_metric_alarm.no_transport_lambda_logs will be destroyed # (because aws_cloudwatch_metric_alarm.no_transport_lambda_logs is not in configuration) - resource "aws_cloudwatch_metric_alarm" "no_transport_lambda_logs" { - actions_enabled = true -> null - alarm_actions = [ - "arn:aws:sns:ca-central-1:871282759583:cbs-cloudwatch-alarm", ] -> null - alarm_description = "CBS Transport lambda is sending logs to CCCS over a 30 minute period" -> null - alarm_name = "NoTransportLambdaNoLogs" -> null - arn = "arn:aws:cloudwatch:ca-central-1:871282759583:alarm:NoTransportLambdaNoLogs" -> null - comparison_operator = "LessThanThreshold" -> null - datapoints_to_alarm = 0 -> null - dimensions = { - "LogGroupName" = "/aws/lambda/CbsTransportLambda" } -> null - evaluation_periods = 6 -> null - id = "NoTransportLambdaNoLogs" -> null - insufficient_data_actions = [] -> null - metric_name = "IncomingLogEvents" -> null - namespace = "AWS/Logs" -> null - ok_actions = [ - "arn:aws:sns:ca-central-1:871282759583:cbs-cloudwatch-alarm", ] -> null - period = 300 -> null - statistic = "Sum" -> null - tags = {} -> null - tags_all = {} -> null - threshold = 100 -> null - treat_missing_data = "notBreaching" -> null } # aws_cloudwatch_metric_alarm.transport_lambda_error will be destroyed # (because aws_cloudwatch_metric_alarm.transport_lambda_error is not in configuration) - resource "aws_cloudwatch_metric_alarm" "transport_lambda_error" { - actions_enabled = true -> null - alarm_actions = [ - "arn:aws:sns:ca-central-1:871282759583:cbs-cloudwatch-alarm", ] -> null - alarm_description = "Errors logged by the CBS transport lambda" -> null - alarm_name = "TransportLambdaErrorLogged" -> null - arn = "arn:aws:cloudwatch:ca-central-1:871282759583:alarm:TransportLambdaErrorLogged" -> null - comparison_operator = "GreaterThanOrEqualToThreshold" -> null - datapoints_to_alarm = 0 -> null - dimensions = {} -> null - evaluation_periods = 1 -> null - id = "TransportLambdaErrorLogged" -> null - insufficient_data_actions = [] -> null - metric_name = "TransportLambdaErrorLogged" -> null - namespace = "CloudBasedSensor" -> null - ok_actions = [ - "arn:aws:sns:ca-central-1:871282759583:cbs-cloudwatch-alarm", ] -> null - period = 60 -> null - statistic = "Sum" -> null - tags = {} -> null - tags_all = {} -> null - threshold = 1 -> null - treat_missing_data = "notBreaching" -> null } # aws_kms_key.sns_cloudwatch will be destroyed # (because aws_kms_key.sns_cloudwatch is not in configuration) - resource "aws_kms_key" "sns_cloudwatch" { - arn = "arn:aws:kms:ca-central-1:871282759583:key/54afea5c-f3a9-43ba-aca1-904ba0dc2ef2" -> null - bypass_policy_lockout_safety_check = false -> null - customer_master_key_spec = "SYMMETRIC_DEFAULT" -> null - description = "KMS key for CloudWatch SNS topic" -> null - enable_key_rotation = false -> null - id = "54afea5c-f3a9-43ba-aca1-904ba0dc2ef2" -> null - is_enabled = true -> null - key_id = "54afea5c-f3a9-43ba-aca1-904ba0dc2ef2" -> null - key_usage = "ENCRYPT_DECRYPT" -> null - multi_region = false -> null - policy = jsonencode( { - Statement = [ - { - Action = "kms:*" - Effect = "Allow" - Principal = { - AWS = "arn:aws:iam::871282759583:root" } - Resource = "*" - Sid = "" }, - { - Action = [ - "kms:GenerateDataKey*", - "kms:Decrypt", ] - Effect = "Allow" - Principal = { - Service = "cloudwatch.amazonaws.com" } - Resource = "*" - Sid = "" }, ] - Version = "2012-10-17" } ) -> null - rotation_period_in_days = 0 -> null - tags = { - "CostCentre" = "cbs-871282759583" - "Product" = "cloud-based-sensor" - "Terraform" = "true" } -> null - tags_all = { - "CostCentre" = "cbs-871282759583" - "Product" = "cloud-based-sensor" - "Terraform" = "true" } -> null } # aws_sns_topic.cloudwatch_alarm will be destroyed # (because aws_sns_topic.cloudwatch_alarm is not in configuration) - resource "aws_sns_topic" "cloudwatch_alarm" { - application_success_feedback_sample_rate = 0 -> null - arn = "arn:aws:sns:ca-central-1:871282759583:cbs-cloudwatch-alarm" -> null - content_based_deduplication = false -> null - fifo_topic = false -> null - firehose_success_feedback_sample_rate = 0 -> null - http_success_feedback_sample_rate = 0 -> null - id = "arn:aws:sns:ca-central-1:871282759583:cbs-cloudwatch-alarm" -> null - kms_master_key_id = "54afea5c-f3a9-43ba-aca1-904ba0dc2ef2" -> null - lambda_success_feedback_sample_rate = 0 -> null - name = "cbs-cloudwatch-alarm" -> null - owner = "871282759583" -> null - policy = jsonencode( { - Id = "__default_policy_ID" - Statement = [ - { - Action = [ - "SNS:GetTopicAttributes", - "SNS:SetTopicAttributes", - "SNS:AddPermission", - "SNS:RemovePermission", - "SNS:DeleteTopic", - "SNS:Subscribe", - "SNS:ListSubscriptionsByTopic", - "SNS:Publish", ] - Condition = { - StringEquals = { - AWS:SourceOwner = "871282759583" } } - Effect = "Allow" - Principal = { - AWS = "*" } - Resource = "arn:aws:sns:ca-central-1:871282759583:cbs-cloudwatch-alarm" - Sid = "__default_statement_ID" }, ] - Version = "2008-10-17" } ) -> null - signature_version = 0 -> null - sqs_success_feedback_sample_rate = 0 -> null - tags = { - "CostCentre" = "cbs-871282759583" - "Terraform" = "true" } -> null - tags_all = { - "CostCentre" = "cbs-871282759583" - "Terraform" = "true" } -> null } # aws_sns_topic_subscription.cloudwatch_alarm will be destroyed # (because aws_sns_topic_subscription.cloudwatch_alarm is not in configuration) - resource "aws_sns_topic_subscription" "cloudwatch_alarm" { - arn = "arn:aws:sns:ca-central-1:871282759583:cbs-cloudwatch-alarm:f93d4648-360c-45d5-a471-81cbdbbcdd78" -> null - confirmation_timeout_in_minutes = 1 -> null - confirmation_was_authenticated = false -> null - delivery_policy = "" -> null - endpoint = (sensitive) -> null - endpoint_auto_confirms = false -> null - filter_policy = "" -> null - filter_policy_scope = "" -> null - id = "arn:aws:sns:ca-central-1:871282759583:cbs-cloudwatch-alarm:f93d4648-360c-45d5-a471-81cbdbbcdd78" -> null - owner_id = "871282759583" -> null - pending_confirmation = false -> null - protocol = "https" -> null - raw_message_delivery = false -> null - redrive_policy = "" -> null - replay_policy = "" -> null - subscription_role_arn = "" -> null - topic_arn = "arn:aws:sns:ca-central-1:871282759583:cbs-cloudwatch-alarm" -> null } Plan: 0 to add, 0 to change, 6 to destroy. ───────────────────────────────────────────────────────────────────────────── Saved the plan to: plan.tfplan To perform exactly these actions, run the following command to apply: terraform apply "plan.tfplan" ```
Show Conftest results ```sh 20 tests, 20 passed, 0 warnings, 0 failures, 0 exceptions ```