Skip to content

Commit e76f4b4

Browse files
authored
fix: Set enforcement mode as disabled for EN by default, as SMTP API does not support report mode.(#497)
1 parent 5af76ee commit e76f4b4

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

modules/fscloud/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ 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.
27+
**Note on Event Notifications**: By default, `disabled` enforcement mode is set for Event Notifications as the SMTP API does not support `report` enforcement mode.
2828

2929
**Note on global_deny variable**: When a `scope` is specified in a rule for the target service, a new separate `global rule` will be created for the respective target service to scope `all the resources` of that service. This can be opted out by setting the variable `global_deny = false`. It is also mandatory to set `global_deny = false` when no scope is specified for the target service.
3030

modules/fscloud/main.tf

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ locals {
9494
"enforcement_mode" : "report"
9595
},
9696
"event-notifications" : {
97-
"enforcement_mode" : "report"
97+
"enforcement_mode" : "disabled"
9898
},
9999
"compliance" : {
100100
"enforcement_mode" : "report"
@@ -397,10 +397,6 @@ module "cbr_rule" {
397397
# lookup the map for the target service name, if empty then pass default value
398398
for apitype in lookup(local.operations_apitype_val, each.key, []) : {
399399
api_type_id = apitype
400-
}] # 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
401-
}] : each.key == "event-notifications" && each.value.enforcement_mode == "report" ? [{
402-
api_types = [{
403-
api_type_id = "crn:v1:bluemix:public:context-based-restrictions::::api-type:control-plane"
404400
}]
405401
}] : [{
406402
api_types = [{

0 commit comments

Comments
 (0)