Skip to content

Commit acd3d60

Browse files
authored
feat: added pre-wired rule for Event Notification (Messagehub) to HPCS (#406)
1 parent e13f05d commit acd3d60

File tree

3 files changed

+21
-10
lines changed

3 files changed

+21
-10
lines changed

modules/fscloud/README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
# Pre-wired CBR configuration for FS Cloud
22

33
This module creates default coarse-grained CBR rules in a given account following a "secure by default" approach - that is: deny all flows by default, except known documented communication in the [Financial Services Cloud Reference Architecture](https://cloud.ibm.com/docs/framework-financial-services?topic=framework-financial-services-vpc-architecture-about):
4-
- Cloud Object Storage (COS) -> Key Management Service (KMS)
5-
- Block Storage -> Key Management Service (KMS)
6-
- IBM Cloud Kubernetes Service (IKS) -> Key Management Service (KMS)
7-
- All IBM Cloud Databases (ICD) services -> Key Management Service (KMS)
4+
- Cloud Object Storage (COS) -> Hyper Protect Crypto Services (HPCS)
5+
- Block Storage -> Hyper Protect Crypto Services (HPCS)
6+
- IBM Cloud Kubernetes Service (IKS) -> Hyper Protect Crypto Services (HPCS)
7+
- All IBM Cloud Databases (ICD) services -> Hyper Protect Crypto Services (HPCS)
88
- Activity Tracker route -> Cloud Object Storage (COS)
99
- Virtual Private Clouds (VPCs) where clusters are deployed -> Cloud Object Storage (COS)
1010
- IBM Cloud VPC Infrastructure Services (IS) -> Cloud Object Storage (COS)
1111
- Virtual Private Cloud workload (eg: Kubernetes worker nodes) -> IBM Cloud Container Registry
1212
- IBM Cloud Databases (ICD) -> Hyper Protect Crypto Services (HPCS)
13-
- IBM Cloud Kubernetes Service (IKS) -> IS (VPC Infrastructure Services)
13+
- IBM Cloud Kubernetes Service (IKS) -> VPC Infrastructure Services (IS)
14+
- Event Streams (Messagehub) -> Hyper Protect Crypto Services (HPCS)
1415

1516

1617
**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`.
@@ -92,7 +93,8 @@ module "cbr_fscloud" {
9293
| <a name="input_allow_at_to_cos"></a> [allow\_at\_to\_cos](#input\_allow\_at\_to\_cos) | Set rule for Activity Tracker to COS, default is true | `bool` | `true` | no |
9394
| <a name="input_allow_block_storage_to_kms"></a> [allow\_block\_storage\_to\_kms](#input\_allow\_block\_storage\_to\_kms) | Set rule for block storage to KMS, default is true | `bool` | `true` | no |
9495
| <a name="input_allow_cos_to_kms"></a> [allow\_cos\_to\_kms](#input\_allow\_cos\_to\_kms) | Set rule for COS to KMS, default is true | `bool` | `true` | no |
95-
| <a name="input_allow_icd_to_kms"></a> [allow\_icd\_to\_kms](#input\_allow\_icd\_to\_kms) | Set rule for ICD to KMS, deafult is true | `bool` | `true` | no |
96+
| <a name="input_allow_event_streams_to_kms"></a> [allow\_event\_streams\_to\_kms](#input\_allow\_event\_streams\_to\_kms) | Set rule for Event Streams (Messagehub) to KMS, default is true | `bool` | `true` | no |
97+
| <a name="input_allow_icd_to_kms"></a> [allow\_icd\_to\_kms](#input\_allow\_icd\_to\_kms) | Set rule for ICD to KMS, default is true | `bool` | `true` | no |
9698
| <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 |
9799
| <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 |
98100
| <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 |

modules/fscloud/main.tf

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,11 @@ locals {
217217
logdnaat_cbr_zone_id = local.cbr_zones["logdnaat"].zone_id
218218
# tflint-ignore: terraform_naming_convention
219219
is_cbr_zone_id = local.cbr_zones["is"].zone_id
220+
# tflint-ignore: terraform_naming_convention
221+
event_streams_cbr_zone_id = local.cbr_zones["messagehub"].zone_id
220222

221223
prewired_rule_contexts_by_service = merge({
222-
# COS -> HPCS, Block storage -> HPCS, ROKS -> HPCS, ICD -> HPCS
224+
# COS -> HPCS, Block storage -> HPCS, ROKS -> HPCS, ICD -> HPCS, Event Streams (Messagehub) -> HPCS
223225
for key in local.kms_values : key => [{
224226
endpointType : "private",
225227
networkZoneIds : flatten([
@@ -233,10 +235,11 @@ locals {
233235
local.databases-for-mongodb_cbr_zone_id,
234236
local.databases-for-mysql_cbr_zone_id,
235237
local.databases-for-postgresql_cbr_zone_id,
236-
local.databases-for-redis_cbr_zone_id] : []
238+
local.databases-for-redis_cbr_zone_id] : [],
239+
var.allow_event_streams_to_kms ? [local.event_streams_cbr_zone_id] : []
237240
])
238241
}] }, {
239-
# Fs VPCs -> COS, AT -> COS, IS (VPC Infrastructure Services) -> COS
242+
# Fs VPCs -> COS, AT -> COS, VPC Infrastructure Services (IS) -> COS
240243
"cloud-object-storage" : [{
241244
endpointType : "direct",
242245
networkZoneIds : flatten([

modules/fscloud/variables.tf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,13 @@ variable "allow_roks_to_kms" {
2828

2929
variable "allow_icd_to_kms" {
3030
type = bool
31-
description = "Set rule for ICD to KMS, deafult is true"
31+
description = "Set rule for ICD to KMS, default is true"
32+
default = true
33+
}
34+
35+
variable "allow_event_streams_to_kms" {
36+
type = bool
37+
description = "Set rule for Event Streams (Messagehub) to KMS, default is true"
3238
default = true
3339
}
3440

0 commit comments

Comments
 (0)