Skip to content

Commit

Permalink
fix: Set enforcement mode as disabled for EN by default, as SMTP API …
Browse files Browse the repository at this point in the history
…does not support report mode.(#497)
  • Loading branch information
Ak-sky authored Aug 8, 2024
1 parent 5af76ee commit e76f4b4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion modules/fscloud/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The module also pre-create CBR zone for each service in the account as a best pr

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.

**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.
**Note on Event Notifications**: By default, `disabled` enforcement mode is set for Event Notifications as the SMTP API does not support `report` enforcement mode.

**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.

Expand Down
6 changes: 1 addition & 5 deletions modules/fscloud/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ locals {
"enforcement_mode" : "report"
},
"event-notifications" : {
"enforcement_mode" : "report"
"enforcement_mode" : "disabled"
},
"compliance" : {
"enforcement_mode" : "report"
Expand Down Expand Up @@ -397,10 +397,6 @@ module "cbr_rule" {
# lookup the map for the target service name, if empty then pass default value
for apitype in lookup(local.operations_apitype_val, each.key, []) : {
api_type_id = apitype
}] # 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
}] : each.key == "event-notifications" && each.value.enforcement_mode == "report" ? [{
api_types = [{
api_type_id = "crn:v1:bluemix:public:context-based-restrictions::::api-type:control-plane"
}]
}] : [{
api_types = [{
Expand Down

0 comments on commit e76f4b4

Please sign in to comment.