turbot/oci_compliance

Control: 4.7 Ensure a notification is configured for user changes

Description

It is recommended to setup an Event Rule and Notification that gets triggered when IAM Users are created, updated, deleted, capabilities updated, or state updated. 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.

Users use or manage Oracle Cloud Infrastructure resources. Monitoring and alerting on changes to Users will help in identifying changes to the security posture.

Remediation

From Console

  1. Using the search box to navigate to events.
  2. Navigate to the rules page.
  3. Select the compartment that should host the rule.
  4. Click Create Rule.
  5. Provide a Display Name and Description.
  6. Create a Rule Condition by selecting Identity in the Service Name Drop-down and selecting: User – Create, User – Delete, User – Update, User Capabilities – Update, User State – Update.
  7. In the Actions section select Notifications as Action Type.
  8. Select the Compartment that hosts the Topic to be used.
  9. Select the Topic to be used.
  10. Optionally add Tags to the Rule.
  11. Click Create Rule.

From CLI

  1. Find the topic-id of the Event Rule which should be used for sending Notifications by using the topic name and Compartment OCID.
oci ons topic list --compartment-id=<compartment OCID> --all --query "data [?name=='<topic_name>']".{"name:name,topic_id:\"topic-id\""} --output table
  1. 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.CreateUser",
"com.oraclecloud.identityControlPlane.DeleteUser",
"com.oraclecloud.identityControlPlane.UpdateUser"],
"com.oraclecloud.identityControlPlane.UpdateUserCapabilities",
"com.oraclecloud.identityControlPlane.UpdateUserState"],
"data":{}
},
"displayName": "<display name>",
"description": "<description>",
"isEnabled": true,
"compartmentId": "compartment OCID"
}
  1. Create the actual event rule.
oci events rule create --from-json file://event_rule.json
  1. 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_7

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run oci_compliance.control.cis_v200_4_7 --share

SQL

This control uses a named query:

events_rule_notification_iam_user_changes

Tags