Control: 4.4 Ensure a notification is configured for IdP group mapping changes
Description
It is recommended to setup an Event Rule and Notification that gets triggered when Identity Provider Group Mappings are created, updated or deleted. Event Rules are compartment scoped and will detect events in child compartments. It is recommended to create the Event rule at the root compartment level.
IAM Policies govern access to all resources within an OCI Tenancy. IAM Policies use OCI Groups for assigning the privileges. Identity Provider Groups could be mapped to OCI Groups to assign privileges to federated users in OCI. Monitoring and alerting on changes to Identity Provider Group mappings will help in identifying changes to the security posture.
Remediation
From Console
- Go to the Events Service page.
- Select the
compartment
that should host the rule. - Click
Create Rule
. - Provide a
Display Name
andDescription
. - Create a Rule Condition by selecting
Identity
in the Service Name Drop-down and selectingIdp Group Mapping – Create
,Idp Group Mapping – Delete
andIdp Group Mapping – Update
. - In the
Actions
section selectNotifications
as Action Type. - Select the
Compartment
that hosts the Topic to be used. - Select the
Topic
to be used. - Optionally add Tags to the Rule.
- Click
Create Rule
.
From CLI
- Find the
topic-id
of the Event Rule which should be used for sending Notifications by using the topicname
andCompartment OCID
.
oci ons topic list --compartment-id=<compartment OCID> --all --query "data [?name=='<topic_name>']".{"name:name,topic_id:\"topic-id\""} --output table
- Create a JSON file to be used when creating the Event Rule. Replace topic id, display name, description and compartment OCID.
{ "actions": { "actions": [ { "actionType": "ONS", "isEnabled": true, "topicId": "<topic id>" }] }, "condition": { "eventType": ["com.oraclecloud.identitycontrolplane.createpolicy", "com. oraclecloud.identitycontrolplane.deletepolicy", "com.oraclecloud.identitycontrolplane.updatepolicy"], "data":{} }, "displayName": "<display name>", "description": "<description>", "isEnabled": true, "compartmentId": "compartment OCID"}
- Create the actual event rule.
oci events rule create --from-json file://event_rule.json
- Note in the JSON returned that it lists the parameters specified in the JSON file provided and that there is an OCID provided for the Event Rule.
Usage
Run the control in your terminal:
powerpipe control run oci_compliance.control.cis_v200_4_4
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run oci_compliance.control.cis_v200_4_4 --share
SQL
This control uses a named query:
events_rule_notification_idp_group_mapping_changes