More Info:
Detect high frequencies of Unauthorized API errors. This behavior maps to attackers or compromised scripts attempting to enumerate permissions and discover accessible resourcesRisk Level
HighAddress
Compliance, SecurityCompliance Standards
- APRA CPS 234 (Australia)
- AWS Well Architected Framework
- BSI C5 (Germany)
- Brazil LGPD
- CCPA / CPRA (California)
- CIS AWS
- CIS Critical Security Controls v8
- CMMC 2.0
- CSA Cloud Controls Matrix v4
- Cloudanix Best Practice
- DPDPA
- Digital Operational Resilience Act (EU)
- Essential 8
- HIPAA
- HITRUST CSF
- ISO 27001
- ISO/IEC 27017
- ISO/IEC 27018
- ISO/IEC 27701
- KSA PDPL
- MAS Technology Risk Management (Singapore)
- MITRE ATT&CK (Cloud)
- NIS2 Directive
- NIST SP 800-171
- NYDFS 23 NYCRR 500
- SOC2
- SWIFT Customer Security Controls Framework
- Sarbanes-Oxley IT General Controls
- UK NCSC Cyber Assessment Framework
Triage and Remediation
- Remediation
Remediation
Using Console
Using Console
Below are the steps to configure an Access Denied Enumeration alarm with OCI Monitoring using only the OCI Console. The idea is:
(Use whatever fields you actually see in your Audit records; click on a log entry and check its JSON.)D. Target
This triggers when more than 20 denied events occur in 5 minutes.Per principal (better for detecting brute-force / enumeration):Adjust thresholds and window to your policy (e.g., 10 denies in 5 minutes per principal).C. Trigger Rule & Window
If you share your current log sample (an example Audit log JSON) and your preferred threshold (e.g., “more than X denied requests in Y minutes per principal”), I can give an exact filter expression and alarm query tailored to your tenancy.
- Use Audit logs as source
- Use Service Connector to turn “access denied” events into a custom metric
- Create an Alarm on that custom metric
1. Confirm Audit Logs Are Enabled
Audit is on by default, but verify:- In the OCI Console, open the Navigation menu.
- Go to Identity & Security → Audit.
- Select your tenancy / compartment.
- Confirm you can see recent audit events.
If not, check compartment/region filters.
2. Create (or Use) a Log for Audit Events
You need the Audit events to be in Logging so Service Connector can use them.- Go to Logging → Logs.
- Click Create log.
- Choose:
- Log Group: select or create (e.g.,
security-log-group). - Log Name: e.g.,
audit-access-log. - Log Source: choose Service logs → Audit (or equivalent, depending on region/console updates).
- Log Group: select or create (e.g.,
- Save/enable the log.
3. Create a Service Connector to Produce a Custom Metric
- Go to Observability & Management → Service Connector Hub.
- Click Create service connector.
- Name: e.g.,
access-denied-metric-connector. - Compartment: choose the security/monitoring compartment.
- Source type: Logging.
- Log Groups: select the log group used for Audit (e.g.,
security-log-group). - Logs: select your Audit log (e.g.,
audit-access-log).
- Target type: Monitoring (Metric).
- Metric namespace: e.g.,
custom_security. - Metric name: e.g.,
access_denied_count. - Metric unit: e.g.,
count.
principal→data.identity.userName(ordata.identity.principalName).sourceIp→data.request.clientIp.service→data.request.serviceName.operation→data.request.action.
- Value expression:
1(each matching log = 1 event). - Aggregation: Sum.
- Review and Create the Service Connector.
- Make sure it’s Enabled and wait a few minutes; generate a few denied actions (e.g., deliberately try something you don’t have permission for) and confirm metrics later.
4. Validate the Custom Metric in Monitoring
- Go to Observability & Management → Monitoring → Metrics explorer.
- Namespace: select
custom_security. - Metric name: select
access_denied_count. - Time period: last 1 hour.
- You should see data points if the Service Connector is working and access-denied events occurred.
5. Create an Alarm on Access Denied Enumeration
- Go to Observability & Management → Alarms.
- Click Create alarm.
- Name: e.g.,
Access-Denied-Enumeration-Alarm. - Compartment: choose appropriate (same where metric is visible).
- Severity: e.g., Critical or Warning depending on policy.
- Statistic: Sum.
- Interval: e.g., 1 minute.
- Trigger delay: e.g., 1 evaluation period (or as desired).
- Under Notification destinations, select or create a Notification Topic (OCI Notifications).
-
If creating a new topic:
- Go to Application Integration → Notifications → Topics (or use the inline option).
- Create topic (e.g.,
security-alerts-topic). - Subscribe an Email, Slack/HTTPS, or PagerDuty endpoint.
- Confirm the subscription by clicking the link in the confirmation email.
- Back in the alarm, select this topic as the destination.
- Ensure Alarm state is set to Enabled.
- Click Create alarm.
6. Test the Alarm
- Generate several intentional access-denied events (e.g., use an IAM user with minimal privileges and attempt multiple unauthorized operations).
- Wait for:
- The audit logs to capture events.
- The Service Connector to convert them into metrics (usually within a couple of minutes).
- The alarm to evaluate and potentially fire.
- Confirm you receive a notification and the alarm status changes to FIRING in the console.
If you share your current log sample (an example Audit log JSON) and your preferred threshold (e.g., “more than X denied requests in Y minutes per principal”), I can give an exact filter expression and alarm query tailored to your tenancy.
Using CLI
Using CLI
Below is a practical way to remediate this using OCI Monitoring + OCI CLI: create an alarm on a metric that tracks access‑denied (“AuthorizationFailure”) activity.Because Monitoring works on metrics, you need either:
Adjust the namespace/metric/dimension and threshold to match your environment and policy.
Notes:
Get full details:Test by generating a few controlled “access denied” events (or by temporarily lowering the threshold) and confirm a notification is sent to your configured subscription.
If you tell me:
- A custom metric that counts access‑denied events from Audit logs, or
- An existing metric from your logging/ SIEM pipeline that already does this.
1. Prerequisites
- OCI CLI installed and configured
- Notification Topic (for alerts)
- Create a topic if you don’t have one:
- Note the returned topic OCID, e.g.:
ocid1.onstopic.oc1..aaaa...
- Metric that counts access-denied events
- Namespace:
security_audit - Metric name:
access_denied_count - Dimension: maybe
errorType = "AuthorizationFailure"
2. Decide alarm logic
Typical query (example):- Trigger when there are ≥ 10 access‑denied events in 5 minutes:
3. Create the alarm using OCI CLI
Replace:<ALARM_COMPARTMENT_OCID>– where the alarm resource lives<METRIC_COMPARTMENT_OCID>– where the metric is emitted<TOPIC_OCID>– your Notifications topic OCID- Adjust
--query-textto your real metric namespace/name/dimensions
--pending-duration "PT5M": alarm must remain in breach 5 minutes before firing (tune as needed).--resolution "1m": evaluate the metric every minute.
namespace in the query (older/other style), omit --namespace and use:4. Verify the alarm
List alarms:If you tell me:
- the exact namespace, metric name, and dimensions you use for access-denied counts,
I can give you a copy‑paste‑readyoci monitoring alarm createcommand tailored to your setup.
Using Python
Using Python
Below is a concrete way to remediate this by creating an OCI Monitoring Alarm (Access Denied / Enumeration) using Python + OCI SDK.
(If you use OCI Notifications to send email/SMS, you also need permission to manage/use topics.)
Adjust values to your environment (namespace/metric/dimensions can be verified in OCI Console → Observability & Management → Metrics Explorer).
If you can share the exact metric/namespace you want to use (e.g., console logins, specific service, or audit-derived metrics), I can adapt the query and code snippet precisely to that metric.
1. Prerequisites
- Install OCI Python SDK:
- Make sure you have an OCI config file (usually
~/.oci/config) with:
- Tenancy OCID
- User OCID
- API key
- Region
- Key fingerprint
- IAM policy in the target compartment/tenancy (for the principal you are using):
2. Choose Metric & Threshold (Access Denied Enumeration)
Use the Identity AuthFailure metric (example – you can adjust):- Namespace:
oci_iam - Metric name:
AuthFailure - Dimension:
errorCode = "NotAuthorizedOrNotFound"(typical for access denied) - Example threshold: more than 20 denied attempts in 5 minutes
3. Python Code to Create the Alarm
This example:- Creates an alarm named
AccessDeniedEnumerationAlarm - Triggers when denied auth failures exceed the threshold
- Sends notifications to an existing OCI Notifications topic (
topic_id)
4. Validate the Alarm
-
In OCI Console:
- Observability & Management → Alarms
- Check that
AccessDeniedEnumerationAlarmexists and is in the correct compartment. - Verify the query, namespace, and destination topic.
- Generate test events (or temporarily lower threshold) to verify the alarm changes to FIRING and sends notifications.
If you can share the exact metric/namespace you want to use (e.g., console logins, specific service, or audit-derived metrics), I can adapt the query and code snippet precisely to that metric.
Using Terraform
Using Terraform
COMPARTMENT_OCIDwith the OCID of the compartment where you want the alarm.NOTIFICATION_TOPIC_OCIDwith the OCID of the OCI Notifications topic that should receive alarm notifications.METRIC_QUERY_FOR_UNAUTHORIZED_ERRORSwith the exact Monitoring query that counts unauthorized / access‑denied API errors at the threshold you require (build and validate this in the Monitoring > Metrics console, then paste the working expression here).
oci_monitoring_alarm in place and does not force replacement of other resources.After editing, terraform plan should show either:+ createof oneoci_monitoring_alarmif it’s new, or~ update in-placeon the existingoci_monitoring_alarmwith thequery,display_name,severity,destinations, oris_enabledarguments changing as configured.

