Implementing Data Retention in Microsoft Sentinel
This lesson explains the analytics and data lake tiers, retention settings, and how to use older data.
Learning outcomes
After completing this lesson, you will be able to:
- Compare the two tiers.
- Explain analytics and total retention.
- Explain the effect of moving a table.
- Describe KQL jobs.
Why retention is a design decision
Some attackers stay undetected for months, and regulations can require logs to be kept for years. Keeping everything in fast storage would be very expensive, whereas keeping too little means that an investigation cannot answer basic questions. Microsoft Sentinel addresses this with tiers, so that high-value data stays ready for detection, and bulk data stays available at low cost.
Two tiers are used in the current design.
Analytics tier or data lake?
Retention settings
Two values are set per table. Analytics retention is how long data stays in the analytics tier. Total retention is how long data is kept altogether, up to 12 years. Data that passes analytics retention stays in the data lake until the total is reached.
Microsoft's documents explain the included period in slightly different ways. They state that solution tables can be extended to 90 days at no charge, and they note that a workspace may carry a 30-day default, which the quickstart advises raising to 90 days. Beyond 90 days, up to two years, is charged in proportion. Check the retention on each workspace.
Manage tables in the Defender portal under Microsoft Sentinel > Configuration > Tables > Manage table. Viewing needs Microsoft Sentinel Reader on the resource group. Changing tiers or retention needs Microsoft Sentinel Contributor on the workspace, with Log Analytics Contributor. Shortening total retention takes effect only after a 30-day wait, which gives protection from a mistake.
Retention numbers
Moving data between tiers
Moving a table from the analytics tier to the data lake tier has a consequence that exam questions test: alerting, hunting and analytics rules that depend on it stop working. Before changing a table, check what depends on it. Tables that drive detection stay in the analytics tier, and high-volume tables with lower detection value move to the data lake.
Basic Logs and Auxiliary plans are older low-cost options that remain visible. Basic Logs tables can be viewed from the Defender portal, but they are managed from the Log Analytics workspace, unless the plan is changed to Analytics.
The Sentinel data lake
The Microsoft Sentinel data lake stores a single copy of data, in Parquet format, with retention of up to 12 years. A workspace must be onboarded to the Defender portal and to the data lake. Data in the lake can be queried with KQL, and analysed in notebooks.
A KQL job runs a query against the lake, once or on a schedule, and promotes the results to the analytics tier. This is the way to use old data for detection. For example, a job can extract a year of connections to a suspicious address, and write them to an analytics table for an investigation. Lake activity auditing is enabled by default. Entra roles control lake access, as the lesson on roles explained.
The data lake
A retention plan
A retention plan begins with requirements, not with tools. The following approach is practical.
-
List requirements
Record legal, regulatory and investigative needs.
-
Classify tables
Separate those that drive detection from those needed only for investigation.
-
Set analytics retention
Keep detection tables for as long as active hunting needs.
-
Set total retention
Set this according to regulation, up to 12 years.
-
Review the cost
Examine Table insights for volume, and adjust the plan.
Other options can keep cost in check. A DCR transformation can reduce what is ingested. A separate storage account can be used as an archive through data export, although the data lake usually makes this unnecessary.
Keeping firewall logs
A company ingests 800 GB a day of firewall logs into the analytics tier, and only two analytics rules use them, which could be replaced by a daily job. Regulators require seven years of retention. Sign-in logs drive many detections. How should the company reduce the cost?
Move the firewall table to the data lake tier, with total retention of seven years, and replace the two rules with a scheduled KQL job that promotes matches to the analytics tier. Keep the sign-in logs in the analytics tier, because they drive detections.
Moving the sign-in logs would stop many detections. Keeping all data in the analytics tier for seven years is not possible, as it has a limit of two years. Deleting the firewall logs would break the regulation.
Can a scheduled analytics rule query a table in the data lake tier?
Show answer
No. Rules need the analytics tier, so a KQL job must promote data first.
Exam Tips
Remember for the exam
- The analytics tier supports rules; the data lake tier does not.
- Total retention reaches 12 years.
- Shortening total retention takes effect after 30 days.
- KQL jobs promote lake data to the analytics tier.