diff --git a/README.md b/README.md index 6a268049..f6c91caf 100644 --- a/README.md +++ b/README.md @@ -422,8 +422,8 @@ module "landing_zone" { | Name | Version | |------|---------| -| [terraform](#requirement\_terraform) | >= 1.3 | -| [aws](#requirement\_aws) | >= 5.26.0 | +| [terraform](#requirement\_terraform) | >= 1.6 | +| [aws](#requirement\_aws) | >= 5.54.0 | | [datadog](#requirement\_datadog) | > 3.0.0 | | [mcaf](#requirement\_mcaf) | >= 0.4.2 | @@ -431,9 +431,9 @@ module "landing_zone" { | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.26.0 | -| [aws.audit](#provider\_aws.audit) | >= 5.26.0 | -| [aws.logging](#provider\_aws.logging) | >= 5.26.0 | +| [aws](#provider\_aws) | >= 5.54.0 | +| [aws.audit](#provider\_aws.audit) | >= 5.54.0 | +| [aws.logging](#provider\_aws.logging) | >= 5.54.0 | | [mcaf](#provider\_mcaf) | >= 0.4.2 | ## Modules @@ -480,9 +480,9 @@ module "landing_zone" { | [aws_guardduty_organization_configuration.default](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/guardduty_organization_configuration) | resource | | [aws_guardduty_organization_configuration_feature.ebs_malware_protection](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/guardduty_organization_configuration_feature) | resource | | [aws_guardduty_organization_configuration_feature.eks_audit_logs](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/guardduty_organization_configuration_feature) | resource | -| [aws_guardduty_organization_configuration_feature.eks_runtime_monitoring](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/guardduty_organization_configuration_feature) | resource | | [aws_guardduty_organization_configuration_feature.lambda_network_logs](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/guardduty_organization_configuration_feature) | resource | | [aws_guardduty_organization_configuration_feature.rds_login_events](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/guardduty_organization_configuration_feature) | resource | +| [aws_guardduty_organization_configuration_feature.runtime_monitoring](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/guardduty_organization_configuration_feature) | resource | | [aws_guardduty_organization_configuration_feature.s3_data_events](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/guardduty_organization_configuration_feature) | resource | | [aws_iam_account_password_policy.audit](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_account_password_policy) | resource | | [aws_iam_account_password_policy.logging](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_account_password_policy) | resource | @@ -546,7 +546,7 @@ module "landing_zone" { | [aws\_config](#input\_aws\_config) | AWS Config settings |
object({|
aggregator_account_ids = optional(list(string), [])
aggregator_regions = optional(list(string), [])
delivery_channel_s3_bucket_name = optional(string, null)
delivery_channel_s3_key_prefix = optional(string, null)
delivery_frequency = optional(string, "TwentyFour_Hours")
rule_identifiers = optional(list(string), [])
})
{| no | | [aws\_config\_sns\_subscription](#input\_aws\_config\_sns\_subscription) | Subscription options for the aws-controltower-AggregateSecurityNotifications (AWS Config) SNS topic |
"aggregator_account_ids": [],
"aggregator_regions": [],
"delivery_channel_s3_bucket_name": null,
"delivery_channel_s3_key_prefix": null,
"delivery_frequency": "TwentyFour_Hours",
"rule_identifiers": []
}
map(object({| `{}` | no | | [aws\_ebs\_encryption\_by\_default](#input\_aws\_ebs\_encryption\_by\_default) | Set to true to enable AWS Elastic Block Store encryption by default | `bool` | `true` | no | -| [aws\_guardduty](#input\_aws\_guardduty) | AWS GuardDuty settings |
endpoint = string
protocol = string
}))
object({|
enabled = optional(bool, true)
finding_publishing_frequency = optional(string, "FIFTEEN_MINUTES")
ebs_malware_protection_status = optional(bool, true)
eks_addon_management_status = optional(bool, true)
eks_audit_logs_status = optional(bool, true)
eks_runtime_monitoring_status = optional(bool, true)
lambda_network_logs_status = optional(bool, true)
rds_login_events_status = optional(bool, true)
s3_data_events_status = optional(bool, true)
})
{| no | +| [aws\_guardduty](#input\_aws\_guardduty) | AWS GuardDuty settings |
"ebs_malware_protection_status": true,
"eks_addon_management_status": true,
"eks_audit_logs_status": true,
"eks_runtime_monitoring_status": true,
"enabled": true,
"finding_publishing_frequency": "FIFTEEN_MINUTES",
"lambda_network_logs_status": true,
"rds_login_events_status": true,
"s3_data_events_status": true
}
object({| `{}` | no | | [aws\_inspector](#input\_aws\_inspector) | AWS Inspector settings, at least one of the scan options must be enabled |
enabled = optional(bool, true)
finding_publishing_frequency = optional(string, "FIFTEEN_MINUTES")
ebs_malware_protection_status = optional(bool, true)
eks_audit_logs_status = optional(bool, true)
lambda_network_logs_status = optional(bool, true)
rds_login_events_status = optional(bool, true)
s3_data_events_status = optional(bool, true)
runtime_monitoring_status = optional(object({
enabled = optional(bool, true)
eks_addon_management_status = optional(bool, true)
ecs_fargate_agent_management_status = optional(bool, true)
ec2_agent_management_status = optional(bool, true)
}), {})
})
object({|
enabled = optional(bool, false)
enable_scan_ec2 = optional(bool, true)
enable_scan_ecr = optional(bool, true)
enable_scan_lambda = optional(bool, true)
enable_scan_lambda_code = optional(bool, true)
resource_create_timeout = optional(string, "15m")
})
{| no | | [aws\_required\_tags](#input\_aws\_required\_tags) | AWS Required tags settings |
"enable_scan_ec2": true,
"enable_scan_ecr": true,
"enable_scan_lambda": true,
"enable_scan_lambda_code": true,
"enabled": false,
"resource_create_timeout": "15m"
}
map(list(object({| `null` | no | | [aws\_security\_hub](#input\_aws\_security\_hub) | AWS Security Hub settings |
name = string
values = optional(list(string))
enforced_for = optional(list(string))
})))
object({|
enabled = optional(bool, true)
auto_enable_controls = optional(bool, true)
auto_enable_default_standards = optional(bool, false)
control_finding_generator = optional(string, "SECURITY_CONTROL")
create_cis_metric_filters = optional(bool, true)
product_arns = optional(list(string), [])
standards_arns = optional(list(string), null)
})
{| no | diff --git a/UPGRADING.md b/UPGRADING.md index 5b12094c..79fa1f8e 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -2,6 +2,181 @@ This document captures required refactoring on your part when upgrading to a module version that contains breaking changes. +## Upgrading to v4.0.0 + +> [!WARNING] +> **Read the diagram in [PR 210](https://github.com/schubergphilis/terraform-aws-mcaf-landing-zone/pull/210) and the guide below! If you currently have EKS Runtime Monitoring enabled, you need to perform MANUAL steps after you have migrated to this version.** + +### Behaviour + +Using the default `aws_guardduty` values: +* `EKS_RUNTIME_MONITORING` gets removed from the state (but not disabled) +* `RUNTIME_MONITORING` is enabled including `ECS_FARGATE_AGENT_MANAGEMENT`, `EC2_AGENT_MANAGEMENT`, and `EKS_ADDON_MANAGEMENT`. +* Minimum required AWS provider has been set to `v5.54.0`, and minimum required Terraform version has been set to `v1.6`. + +### Variables + +The following variables have been replaced: +* `aws_guardduty.eks_runtime_monitoring_status` -> `aws_guardduty.runtime_monitoring_status.enabled` +* `aws_guardduty.eks_addon_management_status` -> `aws_guardduty.runtime_monitoring_status.eks_addon_management_status` + +The following variables have been introduced: +* `aws_guardduty.runtime_monitoring_status.ecs_fargate_agent_management_status` +* `aws_guardduty.runtime_monitoring_status.ec2_agent_management_status` + +### EKS Runtime Monitoring to Runtime Monitoring migration + +#### The issue +After you upgraded to this version. **RUNTIME_MONITORING is enabled. But EKS_RUNTIME_MONITORING is not disabled** as is written in the [guardduty_detector_feature documentation](https://registry.terraform.io/providers/hashicorp/aws/5.68.0/docs/resources/guardduty_detector_feature): _Deleting this resource does not disable the detector feature, the resource in simply removed from state instead._ + +To prevent duplicated costs please **disable** EKS_RUNTIME_MONITORING manually after upgrading. + +> [!IMPORTANT] +> Run all the commands with valid credentials in the AWS account where guardduty is delegated administrator. By default this is the **control tower audit** account. +> It's not possible to execute these steps from the AWS Console as the EKS Runtime Monitoring protection plan has already been removed from the GUI. The only way to control this feature is via the CLI. + +#### Step 1: get the GuardDuty detector id + +``` +aws guardduty list-detectors +``` + +Should display: + +``` +{ + "DetectorIds": [ + "12abc34d567e8fa901bc2d34e56789f0" + ] +} +``` + +> [!IMPORTANT] +> Ensure you run this command in the right region! If GuardDuty is enabled in multiple regions then execute all steps for all enabled regions. + +#### Step 2: update the GuardDuty detector + +_Replace 12abc34d567e8fa901bc2d34e56789f0 with your own regional detector-id. Execute these commands in the audit account:_ + +``` +aws guardduty update-detector --detector-id 12abc34d567e8fa901bc2d34e56789f0 --features '[{"Name" : "EKS_RUNTIME_MONITORING", "Status" : "DISABLED"}]' +``` + +#### Step 3: update the GuardDuty organization settings + +Replace the `<
"auto_enable_controls": true,
"auto_enable_default_standards": false,
"control_finding_generator": "SECURITY_CONTROL",
"create_cis_metric_filters": true,
"enabled": true,
"product_arns": [],
"standards_arns": null
}