L5.1 β€” Sentinel Foundation 🟠

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

Level 5 is an extra-credit track: the main path ends at L4.1, and this level starts here whenever you pick it up β€” before or after Level 6, or not at all. See the Curriculum Map.


Goal: enable Microsoft Sentinel on the workspace this curriculum has been filling since L2.1, and connect only what is free before anything paid. Nothing new gets built β€” the SIEM sits on top of data every previous level already collected.

The IaC lesson: a template can declare its limits as well as its resources β€” this one onboards Sentinel and its free connectors in a single deploy, and its paidAndBlocked output names the one connector no template can enable.


Who this is for Time You need first Cost while it runs
Chapter 1 of Level 5 Β· everyone ~20 min L1.3’s workspace (filled since L2.1), and Microsoft Sentinel Contributor granted to the workshop deploy identity β€” ask the instructor 🟠 $0.00/hr in the trial Β· +$0.31/hr after it

[!WARNING] Sentinel bills analysis on everything in the workspace it is enabled on β€” including the operations data Level 2 collected. The 31-day free trial waives the charges for the first 10 GB/day. Run Level 5 inside the window.


What you’re building

One template turns the existing workspace into a SIEM. Sentinel is enabled on log-iacdemo-l3 β€” the workspace every level has written into since L2.1 β€” and only the free data sources are connected. One paid source stays deliberately out of reach: Microsoft Entra ID sign-in and audit logs need a directory admin, and no template β€” and no Azure role β€” can substitute for that.

flowchart LR
  WS["log-iacdemo-l3<br/>filled since L2.1"]
  SENT["Microsoft Sentinel<br/>onboardingStates"]
  FREE["FREE sources<br/>AzureActivity Β· SecurityAlert<br/>SecurityIncident Β· Health"]
  PAID["PAID + BLOCKED<br/>Entra ID sign-in and audit"]
  DEMOTE["AZFWNetworkRule<br/>β†’ Basic plan"]
  DIR(["Directory admin<br/>Global or Security Administrator"])

  WS --> SENT
  FREE --> SENT
  DEMOTE --> WS
  DIR -.->|"only they can connect this"| PAID
  PAID -. "not deployable from Azure" .-> SENT

  classDef free fill:#eefaf0,stroke:#3a9d5d,color:#1a1a1a
  classDef sent fill:#fff4e5,stroke:#d97706,color:#1a1a1a
  classDef blocked fill:#fdecea,stroke:#c0392b,color:#1a1a1a
  class FREE,DEMOTE free
  class WS,SENT sent
  class PAID,DIR blocked

Text description of this diagram</summary>

Sentinel is enabled on the existing workspace rather than a new one, which is the decision the entire redesign has been building toward: every data source Level 2 and Level 3 connected is already there, and nothing has to be reconnected.

The green boxes are free. Azure Activity has been flowing since L2.1; SecurityAlert and SecurityIncident arrive from the L3.3 export and carry no Sentinel analysis charge at all. The template also demotes AZFWNetworkRule to the Basic plan ($0.50/GB against Analytics’ $2.76, and no Sentinel analysis charge on Basic-tier data), because a table nothing detects on stops being merely verbose once Sentinel is charging $4.76/GB analysis on top. Auxiliary is cheaper still at $0.05/GB but is not offered for a standard Azure resource-log table like this one.

The red boxes are the wall. Microsoft Entra ID sign-in and audit logs are paid data and need a Global Administrator or Security Administrator to connect them in the directory. No Azure permission substitutes for that β€” not your Reader, and not the workshop deploy identity’s Contributor on the resource group. Nobody in this lab can get there from here.

</details>

Source: curriculum/L5.1-sentinel-foundation/main.bicep Β· main.bicepparam


πŸ” Going deeper β€” what switching Sentinel on does to the bill</summary>


The operations data Level 2 has been collecting is already in this workspace, so switching Sentinel on applies a $4.76/GB analysis charge to it as well as the $2.76/GB ingestion you were already paying β€” about $7.52/GB combined on the Analytics plan. That is why L2.4’s table-plan discipline mattered, and why this template demotes the noisiest table on the way in.

The 31-day free trial waives both charges for the first 10 GB/day. This estate fits inside it β€” which is what makes Level 5 nearly free inside the window and the most expensive level in the curriculum outside it.

</details>

πŸ” Going deeper β€” where Sentinel lives from here</summary>


The Azure portal experience retires after 31 March 2027, and the Microsoft Defender portal is the destination. The resources this template deploys are unaffected β€” onboarding, connectors and rules are the same ARM resources either way β€” but the screenshots in any course written today will age out before the retirement does.

</details>

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

Azure RBAC β€” the minimum this chapter needs

Microsoft Sentinel Contributor on the workspace β€” held by the workshop deploy identity, not by you. Its usual plain Contributor is not enough.
Why: onboarding Sentinel and creating data connectors are Microsoft.SecurityInsights operations that Contributor on a resource group does not cover. This is the first chapter where the deploy identity genuinely needs a role upgrade rather than a workaround β€” the instructor grants it before the class, because a failed onboarding at minute five stops the level. Your own Reader access is all you need to verify the results.
Microsoft Entra ID roles

Global Administrator or Security Administrator β€” for the connector this template cannot deploy.
The Microsoft Entra ID data connector is granted in the directory, not the subscription, and in most organisations that is a different team entirely. It is also paid data at about $7.52/GB combined. Both facts belong in the same conversation: you are asking someone else to approve a change that costs you money.

For more info β€” Microsoft Sentinel roles and permissions

</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.1-sentinel-foundation/main.bicepparam
az deployment group create  --resource-group $env:AZURE_RESOURCE_GROUP --parameters curriculum/L5.1-sentinel-foundation/main.bicepparam

You should see: freeDataSources listing what arrives at no charge, paidAndBlocked naming the connector you cannot deploy, and whatToWatch telling you which query to re-run tomorrow.

Keep the demotion off if you want to see the difference:

$env:CURRICULUM_DEMOTE_VERBOSE = "false"   # then compare tomorrow's Usage bill



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

Actions β†’ β€œCurriculum L5 - Microsoft Sentinel” β†’ Run workflow β†’ L5.1 - Sentinel Foundation.

If onboarding fails with an authorisation error, the workshop deploy identity still has its usual Contributor and not Microsoft Sentinel Contributor β€” ask the instructor to grant it. That is the expected failure, not a broken template.



Β  Option 3 Β· GitHub Copilot (plain English)

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

Deploy curriculum/L5.1-sentinel-foundation/main.bicep to my lab resource group ($env:AZURE_RESOURCE_GROUP) with az deployment group create.

Then ask it for the thing that is not yours to give:

Add a Microsoft Entra ID data connector to curriculum/L5.1-sentinel-foundation/main.bicep so we get sign-in logs.

Copilot will write a plausible dataConnectors resource of kind AzureActiveDirectory. It will fail, and the error will be about permissions rather than syntax. The connector requires a directory role no Azure RBAC assignment can grant β€” which is the single most important thing to understand before planning a Sentinel deployment for a real organisation.



βœ… Verify it

  1. Sentinel is on the workspace you expected:

    az sentinel onboarding-state show --workspace-name "log-$env:AZURE_PREFIX-l3" -g $env:AZURE_RESOURCE_GROUP -o table
    
  2. The free connector is live:

    az sentinel data-connector list --workspace-name "log-$env:AZURE_PREFIX-l3" -g $env:AZURE_RESOURCE_GROUP -o table
    

    You should see: the Defender for Cloud connector. Everything L3.3 exported is now Sentinel data at no additional analysis charge.

  3. Confirm the trial is running, and when it ends. In the portal: Microsoft Sentinel β†’ News & guides β†’ Free trial. Write the end date in the class calendar. After it, this estate costs roughly $0.31/hr more.

  4. Do the arithmetic that decides the rest of the level:

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

    You should see: the same table you have been watching since L2.1 β€” but every row on the Analytics plan now costs about $7.52/GB rather than $2.76. Multiply it out. That number is the argument for every table-plan decision in the rest of Level 5.


GitHub feature spotlight Β· The connector you cannot merge your way past

Why it belongs here: everything else in this curriculum has been solvable with a pull request. This is the first thing that is not β€” the Entra ID connector needs a person with a directory role to agree, and no template, review or approval in this repository substitutes for it. Find it: the paidAndBlocked output, which names the blocker rather than failing silently. Beyond the lab: knowing which dependencies are technical and which are organisational is most of what makes a project plan realistic. Docs β†’



➑️ What carries forward

L5.2 writes detections against exactly this data β€” and one of them joins security data to operations data, which is only possible because every level wrote into the same workspace.


🧭 Where next?

Your situation Go to
Ready to keep going β€” write detections on this data L5.2 β€” Detection & Investigation
Want the big picture of this level first 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