azuretrail-token-theft-detection-ir

incident-responsedefensivecloud-identitydetection-engineeringincident-responsedfirartifact-groundedoauthtoken-theft

Multi-Phase Defensive Cloud Identity Analysis Task

One synthetic cloud identity compromise is represented across three artifact sets. Phase 2 is independently solvable from /app/phase2/corpus/ and /app/phase2/rule_schema.md. Phase 1 and Phase 3 each include local advisory/CVE evidence in their own artifact directories. The final outputs must describe the same compromise consistently.

Each phase is scored on its own merits for partial credit, but a passing result requires all three phases AND cross-phase consistency: the phase outputs must describe the same compromise (consistent indicators, CVEs, and campaign), or the task does not pass.

Input artifacts are available at:

/app/phase1/case/              identity and cloud sign-in telemetry
/app/phase1/case/advisory_context.json  Phase 1 CVE/advisory evidence
/app/phase2/corpus/            OAuth activity bundles for detection-rule evaluation
/app/phase2/rule_schema.md     allowed detection-rule schema and matching semantics
/app/phase3/evidence/          incident-response evidence
/app/phase3/evidence/advisory_context.json  Phase 3 CVE/advisory evidence

Write these output files:

/app/output/phase1_identity_report.json
/app/output/phase2_detection_rule.yaml
/app/output/phase3_incident_report.json
/app/output/plan.md

Create /app/output/ if it does not exist.

All required evidence is local to the listed artifact directories. Do not use internet lookups or long-running monitoring commands. Once the four required output files are written and internally consistent, the task is complete.

Investigation chain

This task is designed as a linked investigation, not three isolated worksheets.

  1. Phase 1 — Triage identity telemetry, separate attacker activity from benign VPN, admin, mobile, and service-principal noise, and extract the confirmed malicious application and attacker source IP.
  2. Phase 2 — Author a detection rule that replays against the OAuth bundle corpus using same-event matching (see rule_schema.md). The rule must encode findings from Phase 1, especially the attacker source IP, not just generic OAuth tokens.
  3. Phase 3 — Reconstruct the incident timeline, confirmed indicators, accessed resources, and remediation targets from IR evidence without treating every observed entity as malicious.

Cross-phase consistency

  • Phase 2 does not require Phase 1 or Phase 3 outputs to solve.
  • Phase 1 and Phase 3 each have their own advisory files. Read the advisory evidence in the phase you are scoring: use p1-adv-* event IDs in Phase 1 and p3-adv-* event IDs in Phase 3.
  • The same verified CVE IDs must appear in Phase 1 and Phase 3 when both phases are scored, but each phase must cite its own advisory event IDs. Do not copy Phase 1 advisory IDs into Phase 3 output or vice versa.
  • Rejected or decoy advisory candidates must be omitted from JSON in both phases. Document rejections only in plan.md.

Process Plan

plan.md must briefly describe:

  • The artifact sets you inspected for each phase.
  • How you separated malicious OAuth token theft from benign VPN travel, approved admin consent, mobile mail sync, backup service principal activity, and approved connector maintenance.
  • The detection-rule strategy and why it uses same-event selectors tied to Phase 1 findings.
  • The incident-response reconstruction and remediation strategy.
  • How you checked the three phase outputs for consistency.
  • Which advisory/CVE candidates you rejected as decoys and why (plan only — do not list rejected CVEs in the JSON outputs).

Phase 1 Output

phase1_identity_report.json must be valid JSON:

{
  "compromise_category": "cloud_token_theft|oauth_abuse|credential_stuffing|benign_admin_activity",
  "affected_principal": {"user": "...", "tenant": "..."},
  "capabilities": [
    {
      "name": "capability_name",
      "attck_ids": ["T9999"],
      "evidence_event_ids": ["event-id"]
    }
  ],
  "primary_application": {"display_name": "...", "app_id": "..."},
  "notable_indicators": {
    "users": [],
    "app_ids": [],
    "app_display_names": [],
    "ipv4": [],
    "domains": [],
    "scopes": []
  },
  "related_cves": [
    {
      "cve_id": "CVE-YYYY-NNNN",
      "role": "identity_trust_boundary",
      "vulnerability_class": "short class",
      "evidence_event_ids": ["event-id"]
    }
  ]
}

Suggested capability names for this task are:

  • cloud_account_abuse
  • oauth_consent_grant
  • mailbox_collection
  • token_persistence
  • suspicious_inbox_access

These names are provided for readability and are not an answer key. Capability scoring is based on the ATT&CK IDs and grounded evidence IDs, not arbitrary exact wording alone. If you use a different descriptive capability name, it still needs to map to the same ATT&CK ID and cite the supporting event IDs for that behavior.

Phase 1 requires exact indicator sets: list only the confirmed malicious or compromised indicators supported by the evidence — the attacker-controlled OAuth application, attacker source IPv4 address(es), abused OAuth scopes, and the compromised victim account. Do not include benign VPN, admin portal, mobile sync, backup, or connector-maintenance artifacts in notable_indicators. domains lists attacker-controlled domains only; the victim's own tenant domain is context, not an indicator, so if the campaign used no attacker domain leave domains empty ([]).

Allowed related_cves.role values for verified active CVEs in this case are:

  • identity_trust_boundary

Do not include decoy, rejected, historical, or unverified CVEs in related_cves. Do not use role values such as unverified_decoy, decoy_rejected, or any role containing decoy, reject, historical, background, or unverified. Document rejected CVEs only in plan.md.

Scoring notes (read carefully):

  • Map each behavior to its most specific ATT&CK sub-technique. A parent-only ID (for example T1078 instead of the specific valid-accounts sub-technique) receives only partial credit.
  • Do not over-report. Including ATT&CK techniques not supported by the evidence lowers your precision score, and a small set of clearly-unsupported techniques (for example credential dumping, brute force, or on-host execution) will fail the phase. Report only behaviors the artifacts show.
  • The artifacts contain no relevance, per-event technique, or per-event order labels, and no benign/malicious flags. Which CVE is active, each technique mapping, the attack order (reconstruct it from event timestamps), and which observed entities/indicators are malicious must all be inferred from behavior. Reporting a benign indicator (a routine updater app, corporate IP, admin/backup principal, or admin-only scope) fails the phase.
  • Derive accessed_resources from the confirmed incident behavior, not from a provided list.

Phase 2 Output

phase2_detection_rule.yaml must follow /app/phase2/rule_schema.md. It is a small Sigma-like YAML document with these required top-level keys:

title: Rule title
id: rule-id
status: experimental
detection:
  selection:
    operation: ...
    app_display_name: ...
    source_ip: ...
  condition: selection
fields:
  - event_id
falsepositives:
  - expected benign explanation
level: high

Only the operators and fields allowed by the schema may be used. The verifier uses same-event matching: every selection field you provide must match on a single event inside each malicious bundle.

Required engineering constraints:

  • Include operation so the rule distinguishes OAuth mailbox abuse from connector maintenance sign-ins that never touch a mailbox.
  • Include source_ip using the attacker IPv4 address you confirmed in Phase 1. Approved connector maintenance in the corpus reuses the same application name and OAuth scopes but originates from corporate infrastructure addresses, not the attacker address.
  • Do not stitch together selectors from different events inside the same bundle. A rule that only works by combining one field from a consent event and another from a mailbox event will fail verification.

Phase 3 Output

phase3_incident_report.json must be valid JSON:

{
  "victim": {
    "user": "user@tenant.invalid",
    "tenant": "tenant.invalid"
  },
  "entry_vector": "T9999.999",
  "primary_application": {
    "display_name": "...",
    "app_id": "..."
  },
  "attack_sequence": [
    {
      "order": 1,
      "technique": "T9999",
      "summary": "short grounded step",
      "evidence_event_ids": ["event-id"]
    }
  ],
  "confirmed_indicators": {
    "users": [],
    "app_ids": [],
    "app_display_names": [],
    "ipv4": [],
    "domains": [],
    "scopes": []
  },
  "accessed_resources": ["Mailbox"],
  "related_cves": [
    {
      "cve_id": "CVE-YYYY-NNNN",
      "role": "identity_trust_boundary",
      "evidence_event_ids": ["event-id"]
    }
  ],
  "remediation_actions": [
    {
      "action": "allowed_action_name",
      "target": "exact target",
      "reason": "short reason"
    }
  ]
}

Allowed remediation action names are listed in remediation_catalog.json. Use that catalog for allowed action types and candidate targets.

Required minimum remediation

After filtering mixed IR entities down to the confirmed malicious application, victim account, and attacker source IP, select catalog actions that directly invalidate the malicious OAuth access, remove or disable the malicious application foothold, block the attacker source, and force fresh victim-account authentication. Additional catalog actions are allowed when grounded in the evidence, but do not remediate benign VPN, admin portal, mobile sync, or backup artifacts.

Password reset is optional for this incident. Device-code OAuth abuse does not by itself prove password compromise. You may include it if your tenant IR policy requires a credential reset after OAuth abuse, but omitting it is acceptable when the other necessary OAuth, application, network, and MFA remediation actions are present.

Rules

  1. Include only behaviors supported by the artifacts.
  2. Do not include benign VPN travel, approved admin consent, mobile mail sync, or legitimate service principal activity as malicious findings.
  3. Use exact event IDs from the artifacts when evidence is requested, including CVE/advisory evidence.
  4. Use the most specific ATT&CK technique ID supported by the evidence.
  5. Include only CVEs supported as active in this case. Omit unverified, unrelated, or decoy advisory candidates from related_cves entirely — do not list them with a rejection role or negative entry. Document rejected CVEs only in plan.md.
  6. Use the exact active-case role supported by the advisory evidence for each verified CVE. Never mark an active CVE with a decoy or rejection role.
  7. Keep the three phase outputs consistent with the same compromise and the same verified CVE IDs.
  8. JSON/YAML output files must contain only the required JSON/YAML content, not Markdown.