Lesson 52 — Introduction to SOC Automation
The best SOC automation saves analysts time without sacrificing evidence, control or accountability. Learn how Microsoft Sentinel automation rules and playbooks fit together, and when a human should remain in charge.

What you will learn
Plan reliable, least-privilege automation before building your first workflow.
Lesson 52 — From visibility to action
In Module 5 you built, tested and maintained operational workbooks. A dashboard can show that an incident needs attention; automation can route, enrich and document that incident so the analyst can investigate faster.
The objective is not to remove analysts. It is to reduce repetitive work while retaining evidence-based decisions and safe escalation.
Learning objectives
- Explain SIEM, SOAR and the role of Microsoft Sentinel automation.
- Distinguish automation rules from Azure Logic Apps playbooks.
- Recognise incident and alert automation triggers.
- Classify low-risk enrichment versus high-impact response.
- Design a safe, auditable first workflow.
- Identify permissions, testing and monitoring requirements.
The SOC automation lifecycle
Not every incident needs every stage. A simple assignment rule can be useful without a playbook; a destructive response must not be treated as an ordinary enrichment step.
Step 1 — What can Sentinel automate?
| Task | Example | Typical risk |
|---|---|---|
| Triage | Assign incident owner or add a tag | Low |
| Enrichment | Look up IP reputation or asset criticality | Low to medium |
| Notification | Send a Teams or ticketing alert | Low to medium |
| Coordination | Create or update a case in an approved system | Medium |
| Containment | Disable an account or isolate a device | High |
Risk depends on the organisation, permissions, dependencies and failure consequences. Even notifications can leak sensitive incident details if recipients are wrong.
Step 2 — Automation rules versus playbooks
| Capability | Automation rule | Playbook |
|---|---|---|
| Technology | Native Sentinel automation configuration | Azure Logic Apps workflow |
| Best for | Conditions, incident management actions, invoking playbooks | Multi-step enrichment, integrations, approvals and response |
| Logic | Supported triggers, conditions, order and actions | Triggers, connectors, conditions, branches and error handling |
| Execution | Evaluated by Sentinel | Runs in Logic Apps with configured identity and connections |
| Control | Sentinel permissions and rule configuration | Logic App access, connector permissions and Sentinel authorisation |
Automation rules and playbooks work together, but they are not interchangeable. Exact triggers and actions depend on the Sentinel experience and available connectors.
Step 3 — Understand triggers
An automation rule starts from a supported Sentinel event, such as an incident being created or updated, subject to the rule configuration. Playbooks can use supported Microsoft Sentinel triggers for incident, alert or entity workflows, and can also be run manually where supported.
- Incident trigger: suitable for case-level enrichment and triage.
- Alert trigger: suitable when the workflow is designed around alert context.
- Entity trigger: useful for an analyst-initiated investigation of a specific entity.
Choose the trigger that matches the evidence your workflow actually needs. Do not assume an incident trigger provides every raw event field.
Step 4 — Conditions and ordering
Start with narrow, explainable conditions. For example, a rule may apply only to a defined analytics source or severity and add a review tag. Where several automation rules can run, inspect their order and interactions so one does not undo another.
Guardrail: an automation rule that closes or changes incident status without validating the investigation outcome can conceal active work. Avoid such actions in your first lab.
Step 5 — Design a first low-risk workflow
- Trigger: a test incident is created.
- Condition: incident matches a clearly identified lab source or test marker.
- Action: add an automation tag or comment, using the supported action options.
- Optional playbook: enrich a non-sensitive indicator and return a concise result.
- Analyst decision: review the evidence and decide next steps.
- Audit: record rule name, execution outcome and any errors.
Use an isolated lab or approved test incidents. Avoid disabling users, blocking IPs or isolating endpoints in this introductory exercise.
Step 6 — Plan the playbook
Azure Logic Apps provides the workflow engine. The Microsoft Sentinel connector and other connectors require correctly configured connections and permissions. Exact designer steps vary with the Logic Apps plan and portal experience.
Step 7 — Identity and permissions
- Use least-privilege identities and connector permissions.
- Confirm the identity running the playbook can perform only the intended Sentinel operations.
- Grant Sentinel permission to run the playbook through the appropriate supported configuration.
- Protect API keys, tokens and secrets using approved secret management.
- Separate read-only enrichment access from high-impact response permissions.
- Test with non-administrator roles rather than relying on owner access.
A rule can be configured correctly and still fail when its playbook connection lacks access.
Step 8 — Read-only enrichment example
Before automating response, learn to collect context. This query can help an analyst review recent sign-in failures for a specific test account when SigninLogs is connected.
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
let TargetUser = "analyst.lab@contoso.com";
SigninLogs
| where TimeGenerated >= ago(24h)
| where UserPrincipalName =~ TargetUser
| where ResultType != "0"
| summarize Failures = count(),
FirstSeen = min(TimeGenerated),
LastSeen = max(TimeGenerated)
by IPAddress, AppDisplayName
| order by Failures descReplace the example identity with an authorised lab account. This KQL query is investigation context, not an automatically executable Logic Apps action. To use its result in a playbook, configure an appropriate supported query action and validate its output schema.
Step 9 — Define safe automation boundaries
| Safe default | Why it matters |
|---|---|
| Read-only first | A failed lookup cannot disable a user or device |
| Explicit lab scope | Prevents accidental execution against production incidents |
| Idempotent actions | Repeated triggers should not create duplicate tickets or comments |
| Approval for high-impact steps | Preserves human control over containment decisions |
| Timeouts and retry limits | Prevents runaway workflows and API throttling |
| Failure logging | Makes silent automation failures visible |
Step 10 — Avoid automation loops
Incident updates can trigger further automation. If a playbook changes an incident and that update satisfies another rule, the workflow may repeat. Design conditions and markers to avoid unintended re-entry.
Test repeated execution deliberately. Consider a unique processing marker or state check where supported, and confirm that rerunning a workflow will not duplicate downstream actions.
Step 11 — Human approval and containment
Account disablement, device isolation, IP blocking and access revocation can disrupt legitimate operations. These are high-impact response actions that require explicit authority, suitable evidence, documented criteria and a tested rollback path.
For this module, begin with recommendations and analyst review. We will build towards controlled response workflows only after establishing testing, approvals and auditability.
Step 12 — Measure whether automation helps
Useful operational measures include execution success rate, time saved on repetitive enrichment, number of analyst handoffs, false or unnecessary actions, and average time to triage. Record the baseline before claiming improvement.
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
SecurityIncident
| summarize arg_max(TimeGenerated, *) by IncidentNumber
| where CreatedTime >= ago(7d)
| extend TagsText = tostring(Labels)
| project IncidentNumber, Title, Status,
CreatedTime, TagsText
| order by CreatedTime descThis query inspects the latest incident snapshot and its labels; it does not prove that a playbook ran successfully. Verify execution in the relevant automation and Logic Apps run history. Confirm the labels field in your workspace before using it.
Step 13 — Test failure modes
- The incident has no IP address or other expected entity.
- The connector returns no reputation result.
- The API throttles or times out.
- The Logic App connection has expired or lost access.
- The incident is updated while a workflow is running.
- The workflow is retried or triggered twice.
For each case, define a safe fallback: record the error, avoid unsupported conclusions and route the incident back to an analyst.
Step 14 — Audit and monitoring
Review both the Sentinel automation configuration and the Logic Apps execution history. Track when a workflow started, which incident it processed, what actions were attempted, whether they succeeded and what was escalated to a person.
Protect logs containing incident context. Set operational alerting for failed or unusually frequent runs, and periodically review stale or unused automations.
Agent Foskett case file — The helpful robot
The SOC proudly announced a new automation: every high-severity incident would be closed immediately after an enrichment lookup.
“Very efficient,” said Agent Foskett. “How does it know the threat has been contained?”
“It doesn’t,” replied the engineer. “But the dashboard looks fantastic.”
Agent Foskett opened his notebook. “We appear to have automated the disappearance of the problem rather than the solution.”
The team replaced automatic closure with a read-only enrichment step, an analyst review task and a documented approval path for any response.
Hands-on lab — Design before deployment
- Choose a lab-only incident scenario.
- Document the trigger, conditions, action and expected result.
- Identify the minimum permissions required.
- Define what happens if the incident lacks an entity.
- Define how a second trigger is handled safely.
- Specify what the analyst will see and where the execution is logged.
- Draw the workflow and obtain approval before enabling it.
Deliverable: a one-page automation design with success criteria, failure handling and rollback notes.
Knowledge check
- What is the difference between a Sentinel automation rule and a Logic Apps playbook?
- Why should enrichment be separated from containment?
- What could cause a workflow to execute twice?
- Does a label on an incident prove the Logic App succeeded?
- What evidence should be available after a failed run?
Check your answers: rules evaluate supported events and perform configured actions; playbooks orchestrate multi-step workflows; containment has greater business impact; updates/retries can repeat triggers; no; execution history and error details are needed.
Agent Foskett takeaway
Automate the repeatable work. Keep the evidence visible. Make consequential decisions deliberate.
The logs already knew. The playbook should know its limits.
