Skip to content

Commit 789366a

Browse files
authored
feat: Enable traffic flow from SCC to COS is added (#525)
* feat: cos enf mode enabled and SCC to COS added * addressed review comments * update output description * update output description
1 parent c875b54 commit 789366a

File tree

5 files changed

+27
-15
lines changed

5 files changed

+27
-15
lines changed

modules/cbr-zone-module/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ No modules.
6262

6363
| Name | Description |
6464
|------|-------------|
65-
| <a name="output_zone_crn"></a> [zone\_crn](#output\_zone\_crn) | CBR zone resource crn |
66-
| <a name="output_zone_description"></a> [zone\_description](#output\_zone\_description) | CBR zone resource description |
67-
| <a name="output_zone_href"></a> [zone\_href](#output\_zone\_href) | CBR zone resource link |
68-
| <a name="output_zone_id"></a> [zone\_id](#output\_zone\_id) | CBR zone resource id |
69-
| <a name="output_zone_names"></a> [zone\_names](#output\_zone\_names) | CBR zone resource name |
65+
| <a name="output_zone_crn"></a> [zone\_crn](#output\_zone\_crn) | CBR zone crn |
66+
| <a name="output_zone_description"></a> [zone\_description](#output\_zone\_description) | CBR zone description |
67+
| <a name="output_zone_href"></a> [zone\_href](#output\_zone\_href) | CBR zone link |
68+
| <a name="output_zone_id"></a> [zone\_id](#output\_zone\_id) | CBR zone id |
69+
| <a name="output_zone_names"></a> [zone\_names](#output\_zone\_names) | CBR zone name |
7070
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

modules/cbr-zone-module/outputs.tf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,25 @@
44

55
output "zone_names" {
66
value = var.existing_zone_id == null ? ibm_cbr_zone.cbr_zone[0].name : null
7-
description = "CBR zone resource name"
7+
description = "CBR zone name"
88
}
99

1010
output "zone_description" {
1111
value = var.existing_zone_id == null ? var.zone_description : null
12-
description = "CBR zone resource description"
12+
description = "CBR zone description"
1313
}
1414

1515
output "zone_id" {
1616
value = var.existing_zone_id == null ? ibm_cbr_zone.cbr_zone[0].id : ibm_cbr_zone_addresses.update_cbr_zone_address[0].id
17-
description = "CBR zone resource id"
17+
description = "CBR zone id"
1818
}
1919

2020
output "zone_crn" {
2121
value = var.existing_zone_id == null ? ibm_cbr_zone.cbr_zone[0].crn : null
22-
description = "CBR zone resource crn"
22+
description = "CBR zone crn"
2323
}
2424

2525
output "zone_href" {
2626
value = var.existing_zone_id == null ? ibm_cbr_zone.cbr_zone[0].href : null
27-
description = "CBR zone resource link"
27+
description = "CBR zone link"
2828
}

modules/fscloud/README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ This module creates default coarse-grained CBR rules in a given account followin
55
- Block Storage -> Hyper Protect Crypto Services (HPCS)
66
- IBM Cloud Kubernetes Service (IKS) -> Hyper Protect Crypto Services (HPCS)
77
- All IBM Cloud Databases (ICD) services -> Hyper Protect Crypto Services (HPCS)
8-
- Activity Tracker route -> Cloud Object Storage (COS)
8+
- Event Streams (Messagehub) -> Hyper Protect Crypto Services (HPCS)
99
- Virtual Private Clouds (VPCs) where clusters are deployed -> Cloud Object Storage (COS)
10+
- Activity Tracker route -> Cloud Object Storage (COS)
1011
- IBM Cloud VPC Infrastructure Services (IS) -> Cloud Object Storage (COS)
12+
- Security and Compliance Center (SCC) -> Cloud Object Storage (COS)
1113
- Virtual Private Clouds (VPCs) workload (eg: Kubernetes worker nodes) -> IBM Cloud Container Registry
12-
- IBM Cloud Databases (ICD) -> Hyper Protect Crypto Services (HPCS)
1314
- IBM Cloud Kubernetes Service (IKS) -> VPC Infrastructure Services (IS)
14-
- Event Streams (Messagehub) -> Hyper Protect Crypto Services (HPCS)
1515

1616

1717
**Note on KMS**: the module supports setting up rules for Key Protect, and Hyper Protect Crypto Services. By default the modules set rules for Hyper Protect Crypto Services, but this can be modified to use Key Protect, Hyper Protect, or both Key Protect and Hyper Protect Crypto Services using the input variable `kms_service_targeted_by_prewired_rules`.
@@ -30,6 +30,8 @@ Important: In order to avoid unexpected breakage in the account against which th
3030

3131
**Note on `mqcloud`**: Region and/or instance_id is/are required for service `mqcloud` to create the CBR rule. This service is only available in eu-fr2 region.
3232

33+
**Note on `Security and Compliance Center (SCC) scan`**: Compliance can only be claimed after all the enforcement mode have been set to enabled.
34+
3335
## Note
3436
The services 'directlink', 'globalcatalog-collection', 'iam-groups' and 'user-management' do not support restriction per location.
3537

@@ -120,6 +122,7 @@ module "cbr_fscloud" {
120122
| <a name="input_allow_iks_to_is"></a> [allow\_iks\_to\_is](#input\_allow\_iks\_to\_is) | Set rule for IKS to IS (VPC Infrastructure Services), default is true | `bool` | `true` | no |
121123
| <a name="input_allow_is_to_cos"></a> [allow\_is\_to\_cos](#input\_allow\_is\_to\_cos) | Set rule for IS (VPC Infrastructure Services) to COS, default is true | `bool` | `true` | no |
122124
| <a name="input_allow_roks_to_kms"></a> [allow\_roks\_to\_kms](#input\_allow\_roks\_to\_kms) | Set rule for ROKS to KMS, default is true | `bool` | `true` | no |
125+
| <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 |
123126
| <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 |
124127
| <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 |
125128
| <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 |

modules/fscloud/main.tf

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,8 @@ locals {
246246
is_cbr_zone_id = local.cbr_zones["is"].zone_id
247247
# tflint-ignore: terraform_naming_convention
248248
event_streams_cbr_zone_id = local.cbr_zones["messagehub"].zone_id
249+
# tflint-ignore: terraform_naming_convention
250+
scc_cbr_zone_id = local.cbr_zones["compliance"].zone_id
249251

250252
prewired_rule_contexts_by_service = merge({
251253
# COS -> HPCS, Block storage -> HPCS, ROKS -> HPCS, ICD -> HPCS, Event Streams (Messagehub) -> HPCS
@@ -266,7 +268,7 @@ locals {
266268
var.allow_event_streams_to_kms ? [local.event_streams_cbr_zone_id] : []
267269
])
268270
}] }, {
269-
# Fs VPCs -> COS, AT -> COS, VPC Infrastructure Services (IS) -> COS
271+
# Fs VPCs -> COS, AT -> COS, VPC Infrastructure Services (IS) -> COS, Security and Compliance Center (SCC) -> COS
270272
"cloud-object-storage" : [{
271273
endpointType : "direct",
272274
networkZoneIds : flatten([
@@ -276,7 +278,8 @@ locals {
276278
endpointType : "private",
277279
networkZoneIds : flatten([
278280
var.allow_at_to_cos ? [local.logdnaat_cbr_zone_id] : [],
279-
var.allow_is_to_cos ? [local.is_cbr_zone_id] : []
281+
var.allow_is_to_cos ? [local.is_cbr_zone_id] : [],
282+
var.allow_scc_to_cos ? [local.scc_cbr_zone_id] : [],
280283
])
281284
}] }, {
282285
# VPCs -> container registry

modules/fscloud/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ variable "allow_is_to_cos" {
6969
default = true
7070
}
7171

72+
variable "allow_scc_to_cos" {
73+
type = bool
74+
description = "Set rule for SCC (Security and Compliance Center) to COS, default is true"
75+
default = true
76+
}
77+
7278
variable "zone_service_ref_list" {
7379
type = object({
7480
cloud-object-storage = optional(object({

0 commit comments

Comments
 (0)