Skip to content

Commit bb76ad3

Browse files
fixed-tf-depreciation-and-added-benchmark-3
1 parent b37ceed commit bb76ad3

File tree

4 files changed

+13
-8
lines changed

4 files changed

+13
-8
lines changed

aws_sra_examples/solutions/securityhub/securityhub_org/lambda/src/securityhub.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
SECURITY_HUB_THROTTLE_PERIOD = 0.2
3737
BOTO3_CONFIG = Config(retries={"max_attempts": 10, "mode": "standard"})
3838
AWS_DEFAULT_SBP_VERSION = "1.0.0"
39-
AWS_DEFAULT_CIS_VERSION = "1.2.0"
39+
AWS_DEFAULT_CIS_VERSION = "3.0.0" # Changed from "1.2.0"
4040

4141
try:
4242
MANAGEMENT_ACCOUNT_SESSION = boto3.Session()

aws_sra_examples/terraform/common/sra_execution_role/main.tf

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,17 @@ resource "aws_iam_role" "sra_execution_role" {
1313
Action = "sts:AssumeRole",
1414
Effect = "Allow",
1515
Principal = {
16-
AWS = "arn:${var.aws_partition}:iam::${var.management_account_id}:root"
16+
AWS = format("arn:%s:iam::%s:root", var.aws_partition, var.management_account_id)
1717
}
1818
}]
1919
})
2020

21-
managed_policy_arns = [
22-
"arn:${var.aws_partition}:iam::aws:policy/AdministratorAccess"
23-
]
24-
2521
tags = {
2622
"sra-solution" = var.solution_name
2723
}
24+
}
25+
26+
resource "aws_iam_role_policy_attachment" "sra_execution_role_admin_policy" {
27+
role = aws_iam_role.sra_execution_role.name
28+
policy_arn = format("arn:%s:iam::aws:policy/AdministratorAccess", var.aws_partition)
2829
}

aws_sra_examples/terraform/solutions/security_hub/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ Please navigate to the [installing the AWS SRA Solutions](./../../README.md#inst
182182
| Name | Description | Type | Default | Required |
183183
|------|-------------|------|---------|:--------:|
184184
| <a name="input_audit_account_id"></a> [audit\_account\_id](#input\_audit\_account\_id) | AWS Account ID of the Control Tower Audit account. | `string` | n/a | yes |
185-
| <a name="input_cis_standard_version"></a> [cis\_standard\_version](#input\_cis\_standard\_version) | CIS Standard Version | `string` | `"1.4.0"` | no |
185+
| <a name="input_cis_standard_version"></a> [cis\_standard\_version](#input\_cis\_standard\_version) | CIS Standard Version | `string` | `"3.0.0"` | no |
186186
| <a name="input_compliance_frequency"></a> [compliance\_frequency](#input\_compliance\_frequency) | Frequency to Check for Organizational Compliance (in days between 1 and 30, default is 7) | `number` | `7` | no |
187187
| <a name="input_control_tower_lifecycle_rule_name"></a> [control\_tower\_lifecycle\_rule\_name](#input\_control\_tower\_lifecycle\_rule\_name) | The name of the AWS Control Tower Life Cycle Rule | `string` | `"sra-securityhub-org-trigger"` | no |
188188
| <a name="input_create_lambda_log_group"></a> [create\_lambda\_log\_group](#input\_create\_lambda\_log\_group) | Indicates whether a CloudWatch Log Group should be explicitly created for the Lambda function | `bool` | `false` | no |

aws_sra_examples/terraform/solutions/security_hub/variables.tf

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ variable "sra_solution_name" {
3737
variable "cis_standard_version" {
3838
description = "CIS Standard Version"
3939
type = string
40-
default = "1.4.0"
40+
default = "3.0.0"
41+
validation {
42+
condition = contains(["NONE", "1.2.0", "1.4.0", "3.0.0"], var.cis_standard_version) # Changed to var.cis_standard_version
43+
error_message = "Valid values for cis_standard_version are NONE, 1.2.0, 1.4.0, or 3.0.0."
44+
}
4145
}
4246

4347
variable "compliance_frequency" {

0 commit comments

Comments
 (0)