Azure Sentinel part 1: why detection needs steroids

Azure Sentinel part 1: why detection needs steroids

Detecting Service Principal anomalies in Azure activity logs is challenging:

  • Busy services generate thousands of logs per minute, if not more;
  • Service Principal Names (SPNs) are numerous: you might end up with more service principals than named users in your AAD;
  • A significant number of SPNs have administrative roles, meaning wide-ranging role assignments for performing nearly arbitrary operations in Azure resource providers.
  • With system-assigned Managed Identities, many SPNs have become transient.

For all those reasons, relying on traditional queries to hunt for anomalies is mostly irrelevant.

If we to turn to a statistical approach as an alternate way for chasing anomalies, the only ready-made tool at our disposal is Azure Sentinel time series analysis. This article is the first instalment of a discussion about SPN anomalies detection in Azure Activity:

  • This instalment will explain how time series, like traditional queries, fail to meet our expectations;
  • The next instalment will propose a more efficient solution;
  • A third instalment will provide a tool for injecting simulated threats into the solution in order to test it.

Time series analysis

Let me pick a SPN at random in an automated infra-as-code workload. Over a sample period of about a month, the time series decomposition of Azure operations is looking as follows:

No alt text provided for this image

This SPN is not very active: 221k ops/month is not that much. Despite of this, and even under a high resolution (we used 1 hour steps to make the time series), we see that the decomposition does not show any seasonal component.

Let's dive further into the series and run a default[*] anomalies decomposition:

No alt text provided for this image

The only spotted spike lies between October 22 and 23. This doesn't come as a surprise since it's the most outstanding feature in the original decomposition. Aren't there other anomalies missed by the decomposition?

Let run the anomalies decomposition with the lowest detection threshold[**] to capture more cases:

No alt text provided for this image

Now we see new spikes with very low scores: a plateau between October 4 and 7, a negative spike on October 5, an oscillation between October 7 and 9, a negative spike on October 19. But are they actual anomalies in terms of cybersecurity?

To answer this question, we need more insights: for that, let's summarize count() on the actual operations performed by the SPN:

No alt text provided for this image

The result is fuzzy since one operation overwhelms all others, but we see something unexpected: a Microsoft.Network action with a count of just one. Due to the fuzziness we do not see it on the chart, so let's refine the summarization on log(count()):

No alt text provided for this image

We see that the anomalies raised by the decomposer do not look so suspicious. But there is a security issue on October 10 that is missed by analysis: on the left-hand side of the green arrow, I have highlighted a unique, unprecedented call to the Network resource provider to modify a network interface.

Eventually, the only way to pinpoint the October 10 anomaly is by making series on all the operation values[***], but this triggers many high-score false positives (we see at least 6 of them in the picture below):

No alt text provided for this image

Unfortunately, false positives only get worse as we put more SPNs under our supervision.

There's room for improvement obviously. In the next part, we will see what's wrong with time series and how we can remediate that in Azure Sentinel.

Notes:

[*]: default arguments are: threshold=1.5, seasonality=autodetect, trend='linefit'

[**]: threshold=0.0

[***]: make-series by OperationNameValue

Fazel Ahmad Azizi

Avdelingsleder Arkitektur & Sikkerhet ved Trondheim DIGITAL / Byr?dsomr?de Finans, Trondheim kommune

4 年

Looks very interesting!

Steve Miles

CTO & Chief Geek @Westcoast Cloud |Microsoft MVP & MCT |Author |PetrolHead |Carer |Veteran

4 年

SIEMs {seems] Amazing ??

I love integration, but I'd prefer transparency and independency. I could trust Azure, but most likely my auditors will not. I'm not so much into Azure, is it possible to achieve the same degree of insight with third party tools?

Christophe Parisel

Senior Cloud security architect at Société Générale

4 年

Thanks to Younes Khaldi for his interest into this topic!

回复

要查看或添加评论,请登录

Christophe Parisel的更多文章

  • Adversarial lateral motion in Azure PaaS: are we prepared?

    Adversarial lateral motion in Azure PaaS: are we prepared?

    Lateral motion techniques are evolving in PaaS, and we should be worried. Let's discuss a risk confinement approach.

    19 条评论
  • How will Microsoft Majorana quantum chip ??compute??, exactly?

    How will Microsoft Majorana quantum chip ??compute??, exactly?

    During the 2020 COVID lockdown, I investigated braid theory in the hope it would help me on some research I was…

    16 条评论
  • Zero-shot attack against multimodal AI (Part 2)

    Zero-shot attack against multimodal AI (Part 2)

    In part 1, I showcased how AI applications could be affected by a new kind of AI-driven attack: Mystic Square. In the…

    6 条评论
  • Zero-shot attack against multimodal AI (Part 1)

    Zero-shot attack against multimodal AI (Part 1)

    The arrow is on fire, ready to strike its target from two miles away..

    11 条评论
  • 2015-2025: a decade of preventive Cloud security!

    2015-2025: a decade of preventive Cloud security!

    Since its birth in 2015, preventive Cloud security has proven a formidable achievement. By raising the security bar of…

    11 条评论
  • Exploiting Azure AI DocIntel for ID spoofing

    Exploiting Azure AI DocIntel for ID spoofing

    Sensitive transactions execution often requires to show proofs of ID and proofs of ownership: this requirements is…

    10 条评论
  • How I trained an AI model for nefarious purposes!

    How I trained an AI model for nefarious purposes!

    The previous episode prepared ground for today’s task: we walked through the foundations of AI curiosity. As we've…

    19 条评论
  • AI curiosity

    AI curiosity

    The incuriosity of genAI is an understatement. When chatGPT became popular in early 2023, it was even more striking…

    3 条评论
  • The nested cloud

    The nested cloud

    Now is the perfect time to approach Cloud security through the interplay between data planes and control planes—a…

    8 条评论
  • Overcoming the security challenge of Text-To-Action

    Overcoming the security challenge of Text-To-Action

    LLM's Text-To-Action (T2A) is one of the most anticipated features of 2025: it is expected to unleash a new cycle of…

    19 条评论

社区洞察

其他会员也浏览了