Cloud infrastructure is by nature complex, and it’s constantly changing (at least the names, looking at you Defender 365 XDR). At least, it seems that way. Truth is, security in itself hasn’t evolved a lot. Basic security, according to the Microsoft Digital Defense Report from 2023 can help us protect 99% of all attacks by following these basic principles:
Okay, so I might have lied a bit - we throw in some XDR and a sprinkle of Zero Trust and it sounds a bit fancy, doesn’t it? Truth is, good security is very boring. It’s about getting the basics right, and then building on top of that.
To eximplify this, let’s start with an example. You’re now an IT consultant, congratulations. You have a client, Bob Industries, which is a small/medium business in the market for an XDR or SIEM solution. They also want to know about Copilot for Security. Their reasoning is:
We don’t have enough people to monitor all of our systems, and we need to be able to respond to incidents faster Our current tools don’t cover all their bases
In other words, they seem to be lacking a strategy and a process for implementing it. They are looking for tools to cover their bases, but they don’t have the people or processes in place to handle these tools. They also have E5 licenses, which includes Microsoft XDR, but maybe they are using it out of the box and not configuring it properly?
What would you do? If this company came asking for a security test, I could write it up to the CISO wanting to show how bad things were to secure more budget. But, in this case, let’s review:
My list would be something like this instead:
On top of this, I’ll add in that all of these points should make a point to follow Zero Trust principles. There should be MFA no matter where you are on the network, or what location you are at. We also need to know where our critical data and systems are, and protect them accordingly. Not all systems are equally important, so we need to know what to prioritize.
You should have a strategy (duh). How you implement this strategy needs to be up to the company, but ideally in my eyes it should be some sort of multi year plan, and this plan should start with people and process. If you need a tool, it should be to support your people and process, not the other way around.
The point I’m trying to make is;
If your security strategy is “buying missing tools from your puzzle of coverage” or “we need copilot because we are understaffed” you are doing it wrong in my mind. For most companies, a solid foundation is more important than the latest and greatest tool. It’s also easier to build on top of a solid foundation, than it is to try to build foundations under a lot of different tools with no processes, no people and no plan.
Visualizing helps me understand stuff, so I created a simple diagram to show how I see this process when it comes to high level security strategy:
graph LR
S(((Gather requirements for Security Strategy)))
S --- Bn[Business needs]
S --- Sc[Scope]
A(((Create target/goal for Strategy)))
A --- Ab[Adhere to CIS level 1?]
A --- Ac[Adhere to MCSB?]
B(((Assess state of Strategy)))
B --- Bb[Monitoring]
B --- Bc[Ad-hoc testing]
C(((Report state)))
C --- Cc[Goal/target completion]
S --> A
A --> B
B --> C
C --> S
style S fill:#f00,stroke:#333,stroke-width:4px
style A fill:#c28,stroke:#333,stroke-width:4px
style B fill:#e56,stroke:#333,stroke-width:4px
style C fill:#c90,stroke:#333,stroke-width:4px
This is a cyclical process that has to be followed. The tests you run and the tools you run will change as you go along, as you will reach target/goals and mature your security posture.
With all this in mind, why test yourself? What’s the point? Well, we need to know where we are at and how we are looking. From the perspective of the defender, we have a bunch of settings in different parts of the portals we manage (and tools, and services, and…). Attackers? They run some scripts and easily find our weak spots. So what’s stopping us from doing the same?
They key idea here is - we don’t always need a penetration test or architecture review to check our security. Some of it we can do ourselves, and some of it we can automate. This is where tools come in.
Just a simple reminder here, I will mainly focus on cloud for this part as that’s where I have the most experience. If anyone has any good tips or resources for on-prem, please let me know and I’ll add them in as reference for future articles.
The first two chapters here we’ll touch on are Microsoft Cloud Security Benchmark and Secure Score and Entra ID Identity Secure Score. These are built-in features in Azure and Entra ID that can help us get started with testing our configurations. These are mainly here because it’s a good place to start if you haven’t really been into this before, and the recommendations will tell you what to do for the most part. You can also obviously google to find out more.
First of all, we don’t even need any external tools to get started. If we look at Azure (or even AWS and GCP), we will have a security score in Defender for Cloud that we can look to for guidance. This score for Azure is based on the Microsoft Cloud Security Benchmark and can be used as a good place to start. Simply follow the basic process of looking at the recommendations, and then implementing them.
These recommendations are usually mapped against CIS, NIST, PCI-DSS and other standards, so you can be sure that you are following best practices. After implementing, you can look at the score and see if you are improving over time. This is something that needs to be put into a process, and you need to have people to follow up on this. Best practices change, so your score will drift back down.
We also have a similar score for identity in Entra ID that can be used to follow up on your identity security. Use this similarly to the Secure Score in Defender for Cloud described above.
I read a brilliant article by the UK NCSC on Anti-Patterns in Security Architecture. I’d read it if I was you, but for this I specifically want to discuss higher level functions.
If we refer to the shared responsibility matrix for Azure:
If we decide that we trust Microsoft, the chance that you as an SMB or even as an enterprise will be able to patch your servers better than Microsoft is slim. So if we migrate onto higher level functions and let Microsoft handle that for us, we are able to focus on other things.
This increases security by reducing the attack surface, and it also reduces the complexity of our environment, while freeing up resources to focus on other things.
I’ll admit that for some companies this is not an option, because legacy is legacy and we still need it. But for new companies, designing to avoid legacy and a lot of overhead in terms of IT maintenance is a (probably) good idea.
If we need Virtual Machines we can look to Automatic VM Guest Patching in Azure to help us with patching.
Another option is to look to migrate whatever workload we are running on our compute onto higher level functions, like Azure SQL Managed Instance for databases or Azure App Services for web applications.
Tools have layers. Some tools are broad, while some are specialized. There are a bunch of cool tools for testing your configurations in Azure and Entra ID, things like the AzureADAssessment tool, Extensible Azure Security Tool or EAST which is tool for assessing Azure and to some extent Azure AD security controls and something I recently wrote about, ScubaGear. These tools are pretty broad - they cover a lot of ground, and will validate a lot of settings quickly.
When starting out and testing very broadly, I’d recommend Maester. Maester is, and I quote:
“… a PowerShell based test automation framework to help you stay in control of your Microsoft security configuration.”
It incorporates the entire set of tests from CISAs SCuBA, the Entra ID Attack and Defense Playbooks own config analyzer EIDSCA and a bunch of Maester-only tests. It also allows you to implement custom tests. It’s a great tool to start with, and one that can be implemented into a CI/CD workflow to continuously test and monitor your configurations.
I’m not going to tell you how to use, because this is not the article for that, but they have a pretty good installation guidance as well as guides on implementing it for CI/CD.
Running a simple test standalone is as simple as following the installation guidance and running the following command:
Invoke-Maester
Which will run all tests (*.Tests.ps1
files) in the current directory and subdirectories.
For more specific use cases, I will discuss tools in more detail in future posts. The idea with these tools is to verify more specific use cases and settings. Say you are at a level where you are pretty confident in your security posture, but you want to test if that is the case. These tools will help you with that, in that they will either validate your settings or help you emulate an attack to see if you are vulnerable.
For now, I’ll just mention two familiar tools that I’ve used in the past:
Follow this guidance and you’ll be able to test your own configurations in Entra ID. This tool gives great insight into what you can do against an Azure tenant from the outside, or even as a guest or normal user.
AzureHound is the Azure collector for BloodHound. We can usually with an unprivileged user gather the entire set of information on relationships between users, groups, computers, applications and roles in Entra and Azure RBAC using this tool. It will help you visualize attack paths and thus help you understand where you are vulnerable. A quick win with this tool is to check for shortest paths to privileged admin roles or users and close them down as soon as possible.
This post is a bit messy, I’ll admit, but it boils down to a few simple points.