Skip to content

Commit 10c5bc9

Browse files
authored
feat: added two new inputs to the fscloud profile: allow_vpcs_to_iam_groups and allow_vpcs_to_iam_access_management. By setting these to true, the following FSCloud SCC rules will pass:<br>- Check whether IAM access management can be accessed only thorugh a private endpoint (Context-based restrictions or service) and allowed IPs<br>- Check whether IAM access groups can be accessed only through a private endpoint (Context-based restrictions or service) and allowed IPs` (#548)
1 parent 23289a3 commit 10c5bc9

File tree

3 files changed

+32
-1
lines changed

3 files changed

+32
-1
lines changed

modules/fscloud/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ This module creates default coarse-grained CBR rules in a given account followin
77
- All IBM Cloud Databases (ICD) services -> Hyper Protect Crypto Services (HPCS)
88
- Event Streams (Messagehub) -> Hyper Protect Crypto Services (HPCS)
99
- Virtual Private Clouds (VPCs) where clusters are deployed -> Cloud Object Storage (COS)
10+
- Virtual Private Clouds (VPCs) where clusters are deployed -> IAM groups
11+
- Virtual Private Clouds (VPCs) where clusters are deployed -> IAM access management
1012
- Activity Tracker route -> Cloud Object Storage (COS)
1113
- IBM Cloud VPC Infrastructure Services (IS) -> Cloud Object Storage (COS)
1214
- Security and Compliance Center (SCC) -> Cloud Object Storage (COS)
@@ -125,6 +127,8 @@ module "cbr_fscloud" {
125127
| <a name="input_allow_scc_to_cos"></a> [allow\_scc\_to\_cos](#input\_allow\_scc\_to\_cos) | Set rule for SCC (Security and Compliance Center) to COS, default is true | `bool` | `true` | no |
126128
| <a name="input_allow_vpcs_to_container_registry"></a> [allow\_vpcs\_to\_container\_registry](#input\_allow\_vpcs\_to\_container\_registry) | Set rule for VPCs to container registry, default is true | `bool` | `true` | no |
127129
| <a name="input_allow_vpcs_to_cos"></a> [allow\_vpcs\_to\_cos](#input\_allow\_vpcs\_to\_cos) | Set rule for VPCs to COS, default is true | `bool` | `true` | no |
130+
| <a name="input_allow_vpcs_to_iam_access_management"></a> [allow\_vpcs\_to\_iam\_access\_management](#input\_allow\_vpcs\_to\_iam\_access\_management) | Set rule for VPCs to IAM access management, default is true | `bool` | `true` | no |
131+
| <a name="input_allow_vpcs_to_iam_groups"></a> [allow\_vpcs\_to\_iam\_groups](#input\_allow\_vpcs\_to\_iam\_groups) | Set rule for VPCs to IAM groups, default is true | `bool` | `true` | no |
128132
| <a name="input_custom_rule_contexts_by_service"></a> [custom\_rule\_contexts\_by\_service](#input\_custom\_rule\_contexts\_by\_service) | Any additional context to add to the CBR rules created by this module. The context are added to the CBR rule targetting the service passed as a key. The module looks up the zone id when service\_ref\_names or add\_managed\_vpc\_zone are passed in. | <pre>map(list(object(<br/> {<br/> endpointType = string # "private, public or direct"<br/><br/> # Service-name (module lookup for existing network zone) and/or CBR zone id<br/> service_ref_names = optional(list(string), [])<br/> add_managed_vpc_zone = optional(bool, false)<br/> zone_ids = optional(list(string), [])<br/> })))</pre> | `{}` | no |
129133
| <a name="input_existing_cbr_zone_vpcs"></a> [existing\_cbr\_zone\_vpcs](#input\_existing\_cbr\_zone\_vpcs) | Provide a existing zone id for VPC | <pre>object(<br/> {<br/> zone_id = string<br/> })</pre> | `null` | no |
130134
| <a name="input_existing_serviceref_zone"></a> [existing\_serviceref\_zone](#input\_existing\_serviceref\_zone) | Provide a valid service reference and existing zone id | <pre>map(object(<br/> {<br/> zone_id = string<br/> }))</pre> | `{}` | no |

modules/fscloud/main.tf

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,23 @@ locals {
296296
var.allow_iks_to_is ? [local.containers-kubernetes_cbr_zone_id] : []
297297
])
298298
}]
299-
})
299+
}, {
300+
# VPCs -> iam-groups
301+
"iam-groups" : [{
302+
endpointType : "private",
303+
networkZoneIds : flatten([
304+
var.allow_vpcs_to_iam_groups ? [local.cbr_zone_vpcs.zone_id] : [],
305+
])
306+
}] }, {
307+
# VPCs -> iam-access-management
308+
"iam-access-management" : [{
309+
endpointType : "private",
310+
networkZoneIds : flatten([
311+
var.allow_vpcs_to_iam_access_management ? [local.cbr_zone_vpcs.zone_id] : [],
312+
])
313+
}]
314+
}
315+
)
300316

301317
prewired_rule_contexts_by_service_check = { for key, value in local.prewired_rule_contexts_by_service :
302318
key => [

modules/fscloud/variables.tf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,17 @@ variable "allow_vpcs_to_cos" {
5151
default = true
5252
}
5353

54+
variable "allow_vpcs_to_iam_groups" {
55+
type = bool
56+
description = "Set rule for VPCs to IAM groups, default is true"
57+
default = true
58+
}
59+
60+
variable "allow_vpcs_to_iam_access_management" {
61+
type = bool
62+
description = "Set rule for VPCs to IAM access management, default is true"
63+
default = true
64+
}
5465
variable "allow_at_to_cos" {
5566
type = bool
5667
description = "Set rule for Activity Tracker to COS, default is true"

0 commit comments

Comments
 (0)