Skip to content

Commit fa554b3

Browse files
authored
fix: Event Notifications introduced SMTP API that does not support report enforcement mode. By default report mode is set which excludes SMTP API. If enforcement mode is set to enabled, CBR will be applied to the SMTP API as well.<br>- Added MQ segmentation to add data plane API type id (#485)
1 parent 9ab35b1 commit fa554b3

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

examples/fscloud/main.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ module "cbr_account_level" {
8585
"target_rg" = module.resource_group.resource_group_id
8686
"global_deny" = false
8787
}
88+
"mqcloud" : {
89+
"enforcement_mode" = "disabled"
90+
"region" = "eu-fr2" # BNPP region
91+
"global_deny" = false
92+
}
8893
}
8994

9095
# Demonstrates how a customized name can be set for the CBR zone

modules/cbr-service-profile/main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ locals {
2929
databases-for-mongodb = local.icd_api_types,
3030
databases-for-postgresql = local.icd_api_types,
3131
databases-for-redis = local.icd_api_types,
32-
messages-for-rabbitmq = local.icd_api_types
32+
messages-for-rabbitmq = local.icd_api_types,
33+
mqcloud = local.icd_api_types
3334
}
3435

3536
vpc_zone_list = (length(var.zone_vpc_crn_list) > 0) ? [{

modules/fscloud/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ The module also pre-create CBR zone for each service in the account as a best pr
2424

2525
Important: In order to avoid unexpected breakage in the account against which this module is executed, the CBR rule enforcement mode is set to 'report' (or 'disabled' for services not supporting 'report' mode) by default. It is recommended to test out this module first with these default, and then use the `target_service_details` variable to set the enforcement mode to "enabled" gradually by service. The [usage example](../../examples/fscloud/) demonstrates how to set the enforcement mode to 'enabled' for the key protect ("kms") service.
2626

27+
**Note on Event Notifications**: Event Notifications introduced SMTP API that does not support `report` enforcement mode. By default `report` mode is set which excludes SMTP API. If enforcement mode is set to `enabled`, CBR will be applied to the SMTP API as well.
28+
2729
## Note
2830
The services 'directlink', 'globalcatalog-collection', 'iam-groups' and 'user-management' does not support restriction per location.
2931

modules/fscloud/main.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,7 @@ locals {
345345
databases-for-redis = local.icd_api_types,
346346
messages-for-rabbitmq = local.icd_api_types,
347347
databases-for-mysql = local.icd_api_types
348+
mqcloud = local.icd_api_types
348349
}
349350

350351
fake_service_names = {
@@ -401,6 +402,10 @@ module "cbr_rule" {
401402
# lookup the map for the target service name, if empty then pass default value
402403
for apitype in lookup(local.operations_apitype_val, each.key, []) : {
403404
api_type_id = apitype
405+
}] # Addding condition below for Event Notifications to enable CBR for control plane API explicitly for report mode as SMTP API does not support report mode
406+
}] : each.key == "event-notifications" && each.value.enforcement_mode == "report" ? [{
407+
api_types = [{
408+
api_type_id = "crn:v1:bluemix:public:context-based-restrictions::::api-type:control-plane"
404409
}]
405410
}] : [{
406411
api_types = [{

0 commit comments

Comments
 (0)