L5.3 β€” SOC Operations & Automation 🟠

πŸ“ Level 5 Β· Detect Β· Chapter 3 of 3 Β Β·Β  Previous: L5.2 β€” Detection & Investigation Β Β·Β  Next: Level 6 Β· Recover


Goal: operate the SIEM β€” automate the repetitive parts of response, and close the level by measuring what the whole thing costs.

The IaC lesson: response automation is code too β€” the automation rules and the playbook’s triage questions live in this repository, so the SOC’s routine improves through pull requests instead of drifting between analysts.


Who this is for Time You need first Cost while it runs
Chapter 3 of Level 5 · everyone ~20 min L5.2 🟠 ~$0.01/hr added · ~$2.11/hr in the trial, ~$2.45/hr after

[!IMPORTANT] Automation rules run before a human sees the incident. The auto-close rule in this template is off by default β€” an auto-closed incident is one nobody looked at, so argue about it in class before enabling it.


What you’re building

Two automation rules and one playbook stand between a new incident and the analyst. The safe rule tags and prioritises; the risky one auto-closes and ships disabled. The playbook enriches incidents over a plain HTTP trigger with no API connections, so it deploys and runs without anyone’s consent screen.

flowchart LR
  INC["incidents from L5.2"]
  AR1["automation rule 1<br/>tag + prioritise High"]
  AR2["automation rule 2<br/>auto-close Informational<br/>OFF by default"]
  PB["logic-iacdemo-incident-enrich<br/>HTTP trigger Β· no connectors"]
  HUMAN(["analyst"])

  INC --> AR1 --> HUMAN
  INC -.-> AR2
  AR1 --> PB --> HUMAN

  classDef inc fill:#fff4e5,stroke:#d97706,color:#1a1a1a
  classDef safe fill:#eefaf0,stroke:#3a9d5d,color:#1a1a1a
  classDef risky fill:#fdecea,stroke:#c0392b,color:#1a1a1a
  class INC,PB inc
  class AR1,HUMAN safe
  class AR2 risky

Text description of this diagram</summary>

Incidents from L5.2 pass through automation rules before an analyst sees them.

The first rule tags and prioritises High-severity incidents β€” additive, reversible, and safe to run unattended. The second closes Informational incidents automatically and is off by default: it is the automation rule most likely to be regretted, because it removes things from a queue nobody is then watching.

The playbook is HTTP-triggered with no API connections, for the same reason as L3.3: a connector needs an interactive OAuth consent that no deployment can perform, so a Teams-posting version would deploy green and fail on first run. This one composes the first thirty seconds of triage β€” what, how bad, which resource, and three questions to ask β€” so the routine is written down once rather than remembered differently by each analyst.

</details>

Source: curriculum/L5.3-soc-operations/main.bicep Β· main.bicepparam


πŸ” Going deeper β€” the cost Azure Cost Management cannot see</summary>


The largest cost in a SOC does not appear on the Azure bill. Analyst time is. Automation rules, playbook triggers, workbooks and incident management are all free in Sentinel; what you are optimising with them is the expensive resource that Azure Cost Management cannot see. Say that explicitly when presenting this level, or the automation looks like a rounding error.

</details>

πŸ” Going deeper β€” the permissions this needs</summary>

Azure RBAC β€” the minimum this chapter needs

Microsoft Sentinel Contributor for the automation rules, plus Contributor for the Logic App β€” both requirements on the workshop deploy identity, which already holds them after L5.1. You verify everything below with Reader.
Why: automation rules are Sentinel resources; the playbook is an ordinary Logic App. There is a subtlety worth knowing β€” for Sentinel to run a playbook it needs the Microsoft Sentinel Automation Contributor role on the playbook resource group, which the portal grants for you the first time and a template does not. If a playbook never fires from an automation rule, that missing grant is why.
Microsoft Entra ID roles

Cloud Application Administrator or Global Administrator β€” the moment you add a connector.
Same wall as L3.3, and it arrives here for real. Posting to Teams, sending mail or opening a ticket needs an API connection and an interactive consent. Whether an analyst can consent for themselves is a tenant setting; in most organisations it is not, and the SOC has to ask.

For more info β€” Sentinel playbooks, and the permissions that let one actually run

</details>



[!NOTE] 🏫 Classroom: use the GitHub Actions option. Your Azure account holds Reader, so local az deployment commands will be refused β€” deploys go through your fork’s workflow, which uses the workshop deploy identity automatically. Compiling locally (az bicep build) works for everyone.

πŸš€ Deploy it β€” pick any one of three ways



1 Β· Bicep CLI
Copy-paste in the terminal


2 Β· GitHub Actions
One button in the browser


3 Β· GitHub Copilot
Ask AI in plain English



Β  Option 1 Β· Bicep from the terminal

az deployment group what-if --resource-group $env:AZURE_RESOURCE_GROUP --parameters curriculum/L5.3-soc-operations/main.bicepparam
az deployment group create  --resource-group $env:AZURE_RESOURCE_GROUP --parameters curriculum/L5.3-soc-operations/main.bicepparam

You should see: autoCloseWarning making the case against the rule you did not enable, and closingExercise naming the thing to do before you finish the level.

Enable auto-close only after the argument:

$env:CURRICULUM_AUTO_CLOSE = "true"



Β  Option 2 Β· GitHub Actions (push-button)

Actions β†’ β€œCurriculum L5 - Microsoft Sentinel” β†’ Run workflow β†’ L5.3 - SOC Operations & Automation.

Nothing here is expensive or irreversible, so a straight run is fine.



Β  Option 3 Β· GitHub Copilot (plain English)

Load your values first: ./scripts/Load-LabSettings.ps1. Then in Copilot Chat β†’ Agent mode:

Deploy curriculum/L5.3-soc-operations/main.bicep to my lab resource group ($env:AZURE_RESOURCE_GROUP) with az deployment group create.

Then hit the wall on purpose:

Add a Microsoft Teams β€œpost message in a chat” action to the playbook in curriculum/L5.3-soc-operations/main.bicep so incidents are announced in our SOC channel.

It compiles. It deploys. The connection lands unauthorised, and the first run fails. Someone with the right directory role has to open it and consent. That is the third time this curriculum has hit the same boundary β€” L3.3, L5.1 and now here β€” and by now the pattern should be predictable rather than surprising.



βœ… Verify it

  1. The automation rule is in place and ordered:

    az sentinel automation-rule list --workspace-name "log-$env:AZURE_PREFIX-l3" -g $env:AZURE_RESOURCE_GROUP `
      --query "[].{name:displayName, order:order, enabled:triggeringLogic.isEnabled}" -o table
    
  2. Trigger the playbook by hand to prove the wiring before trusting it:

    $url = az rest --method post --uri "$(az logic workflow show -g $env:AZURE_RESOURCE_GROUP -n "logic-$env:AZURE_PREFIX-incident-enrich" --query id -o tsv)/triggers/When_an_incident_is_created/listCallbackUrl?api-version=2019-05-01" --query value -o tsv
    Invoke-RestMethod -Method Post -Uri $url -ContentType "application/json" -Body '{"Title":"test","Severity":"High","IncidentNumber":"0"}'
    

    You should see: the triage summary returned, with the three first questions in it.

  3. Measure the SOC, not just the alerts. In the portal, open the built-in Security Operations Efficiency workbook.

    You should see: mean time to triage, mean time to close, and the false-positive rate. With two rules and a week of data these numbers are meaningless β€” and knowing they are meaningless at this sample size is itself the lesson.

  4. Close the level with the cost review. Re-run the Usage query one last time, and this time act on it:

    az monitor log-analytics query --workspace $WS `
      --analytics-query "Usage | where TimeGenerated > ago(24h) and IsBillable | summarize GB=sum(Quantity)/1000 by DataType | extend SentinelDailyUSD = round(GB * 7.52, 2) | order by GB desc" -o table
    

    You should finish this level having turned off at least one connector or demoted at least one table, and be able to say what it saved. A SIEM that only ever grows is a budget problem waiting to be somebody else’s emergency.


GitHub feature spotlight Β· The response routine, written down once

You just used it: the three triage questions in the playbook are in the repository, so they get better through pull requests instead of drifting between analysts. Find it: the firstQuestions array in the Enrich action. Beyond the lab: the difference between a SOC and a group of people answering alerts is whether the routine is written down somewhere it can be improved. Docs β†’



➑️ What carries forward

Level 5 is a terminal track β€” pair it with Level 6 Β· Recover in either order. When the class ends, tear down deliberately: disabling Sentinel does not delete the workspace, and retained data keeps billing.


🧭 Where next?

Your situation Go to
Level 5 complete β€” take the other terminal track Level 6 Β· Recover
Want the big picture of this level Level 5 Β· Detect overview
Done for the day β€” the estate bills while idle Cleanup & Reset
Something didn’t work Troubleshooting
β¬… Back to the main path grid πŸ—ΊοΈ Curriculum Map