Skip to main content

Triage and Remediation

Remediation

Using Console

Below are step‑by‑step instructions to configure a Monitoring alarm in OCI Console that alerts when local authentication is used (e.g., local IAM users logging into the Console).Because metric and dimension names can vary slightly by tenancy/region, I’ll show you how to find the right metric interactively and then wire it into an alarm.

1. Open Monitoring → Alarms

  1. Sign in to the OCI Console.
  2. In the left menu, go to:
    Observability & Management → Monitoring → Alarms.
  3. Make sure you’re in the correct region and compartment (top-left selectors).

2. Start Creating the Alarm

  1. Click Create alarm.
  2. Enter:
    • Alarm name: e.g. local-authentication-alarm
    • Alarm severity: typically Critical or Warning.
    • Alarm compartment: your security/monitoring compartment.

3. Select the Metric for Local Authentication

  1. Under Alarm body, click Select metric.
  2. In the Metric namespace dropdown, choose the IAM/Authentication namespace (commonly something like):
    • oci_iam_authentication
      or search for iam, identity, or auth in the namespace box.
  3. In the Metric name dropdown, look for a metric that records authentication attempts, e.g.:
    • AuthenticationRequests, AuthenticationSuccess, AuthenticationFailures
      (the exact name may differ; you can see a preview graph when selected).
  4. Once a likely metric is selected, use the Dimensions panel to filter for local authentication. Look for dimensions such as:
    • identityProviderType or authenticationMethod = LOCAL or LOCAL_USER
    • or similar wording indicating “local” vs “federated/SAML”.
  5. Apply the filter. Confirm the metric graph now shows data only for local-auth events.
If you don’t see any local events, try:
  • Removing all filters and then
  • Adding filters one-by-one while watching how the graph changes to locate the “local” dimension value.

4. Define the Alarm Query / Condition

  1. After metric selection and filters, OCI will build a Monitoring Query Language (MQL) expression for you.
  2. Typical pattern (example – yours will be auto-generated):
    or something similar generated by the console.
  3. Set:
    • Interval (e.g. 5 minutes)
    • Trigger rule:
      • Condition: >
      • Threshold: 0
      • Breaching duration: e.g. 1 interval.
This means: “If any local authentication occurs in the last 5 minutes, fire the alarm.”

5. Configure Notifications

  1. Under Notifications, choose an existing topic or click Create a topic (this opens the Notifications service):
    • Add email addresses, Slack/HTTPS, PagerDuty, etc., as subscriptions for this topic.
  2. Back in the alarm form, select that topic as the Destination.
  3. Optionally, customize:
    • Alarm message (include “Local authentication detected”)
    • Repeat notification frequency.

6. Set Alarm State Management

Configure:
  • Auto-resolve: enabled (so alarm returns to OK when condition clears).
  • Suppression (optional): e.g., suppress after firing to avoid notification storms.

7. Review and Create

  1. Review all details:
    • Correct compartment + region
    • Metric namespace/name
    • Filter for local authentication
    • Condition > 0 over a short period
    • Notification topic configured
  2. Click Create alarm.

8. Test the Alarm

  1. Trigger a local authentication (sign in with a local IAM user) or wait for one to occur.
  2. Check:
    • Monitoring → Alarms: alarm state should change to FIRING when a local auth occurs.
    • Your email/notification channel receives the alert.
If it doesn’t fire, adjust:
  • Metric dimensions (ensure you’re truly filtering for the LOCAL value),
  • Interval and threshold (maybe volume is low; try longer window like 15m).

This completes remediation: you now have an OCI Monitoring alarm that detects and alerts on local authentication events via the OCI Console.
Below is a concise, CLI‑only way to remediate “OCI Monitoring Should Have Local Authentication Alarm Configured” by creating an alarm that fires when there are local console sign‑ins.
Assumptions (adjust as needed):
  • You want to alert on any local console sign‑in in a given compartment.
  • Metric namespace: oci_identity
  • Metric name: ConsoleSignins
  • Dimension for auth method: authType (value LOCAL for local auth)

1. Set common variables


2. Create an ONS topic for alerts

Note the ocid of the topic from the output (call it TOPIC_OCID).

3. (Optional) Add a subscription (email, pager, etc.)

Confirm the subscription via email (if using email).

4. Confirm metric and dimensions (one‑time validation)

Run once to see actual metric/dimension names in your tenancy:
Look in the response for:
  • name: ConsoleSignins
  • Dimensions, including something like authType (value LOCAL for local auth).
    If the dimension name/value differs, update the query in step 5 accordingly.

5. Create the alarm for local authentication

Example: trigger when any local sign‑in occurs in a 5‑minute window.
Key parts:
  • ConsoleSignins[5m]{authType="LOCAL"}.sum() > 0
    • Filters to local auth sign‑ins.
    • Sums them over 5 minutes.
    • Fires if more than 0 events occur.
Adjust:
  • pending-duration for how long the condition must hold (e.g. PT5M).
  • Add more filters (e.g., status="SUCCESS" or region).

6. Verify the alarm

List alarms:
Check alarm status and configuration:
Once this alarm exists and is enabled, the “OCI Monitoring Should Have Local Authentication Alarm Configured” requirement is typically satisfied, as you now have a monitoring alarm explicitly detecting local authentication events.
Below is one practical way to meet the requirement “OCI Monitoring Should Have Local Authentication Alarm Configured” using Python:Idea:
  1. Turn local authentication events into a custom metric (via Logging → Service Connector → Monitoring).
  2. Create an alarm in OCI Monitoring that fires whenever the metric shows any local logins.
  3. Do step 2 with Python.

1. Prerequisites

  • OCI Python SDK installed:
  • A working ~/.oci/config file (or equivalent config in code).
  • Permissions for:
    • Logging
    • Service Connector Hub
    • Monitoring
    • Notifications (if you want email/Slack/etc.)

2. Enable/Confirm Logging for Local Authentication

  1. In OCI Console:
    • Go to Identity & Security → Identity Domains (or IAM, depending on your tenancy type).
    • Open your Identity Domain.
    • Go to Security → Logs (or Audit Logs / Security Events Logs).
    • Ensure SecurityEvents / Authentication (or similar) logs are enabled.
    • These logs contain events for local authentication (local user passwords, etc.).
You need these logs as the source for your metric.

3. Create a Service Connector: Logs → Monitoring (Custom Metric)

You can do this via console (simpler) or via Terraform/SDK. Minimal console steps:
  1. Go to Developer Services → Service Connector Hub → Service Connectors → Create Service Connector.
  2. Source:
    • Type: Logging
    • Select the Log Group where your Security / Authentication / Local auth logs are emitted.
  3. Target:
    • Type: Monitoring
    • Choose a Namespace, e.g. security_custom.
    • Choose a Metric name, e.g. local_authentication_count.
  4. Transformation / Filter:
    • Add a log filter that only matches local authentication events.
      Example (pseudocode style filter – adapt to actual log field names):
    • In the metric mapping, set:
      • value: 1
      • dimensions: include things like userName, authMethod, etc. if available.
  5. Save and activate the Service Connector.
Result: Every local authentication log produces +1 on metric:
  • Namespace: security_custom
  • Metric: local_authentication_count

4. Decide on Alarm Condition

Common requirement: alarm on any local auth in last X minutes. Example:
This means: if at least 1 local auth in the last 5 minutes, trigger the alarm.

5. Python Script to Create the OCI Monitoring Alarm

Below is example code using the OCI Python SDK.What it does:
  • Uses a profile from ~/.oci/config (e.g. DEFAULT).
  • Creates an alarm on the metric from step 3.
  • Sends alarm notifications to an OCI Notifications topic.

Notes

  • query format is:
    namespace.metric_name[window].statistic() <operator> value
  • Window: [5m] = last 5 minutes.
  • Statistic: .sum() here. You can also use .count() or .max() depending on how you emit the metric.

6. Test

  1. Perform a test local authentication (e.g., sign in as a local user).
  2. Confirm:
    • Log entry appears in the Security/Authentication logs.
    • Service Connector sends data to Monitoring (you can view the metric under Monitoring → Metrics Explorer using security_custom namespace).
    • The alarm triggers and sends a notification to the configured topic.

If you share the exact log shape (sample JSON for a local auth event), I can give you a more precise filter expression and metric mapping for the Service Connector.