Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Mastering Microsoft 365 Defender

You're reading from  Mastering Microsoft 365 Defender

Product type Book
Published in Jul 2023
Publisher Packt
ISBN-13 9781803241708
Pages 572 pages
Edition 1st Edition
Languages
Authors (2):
Ru Campbell Ru Campbell
Profile icon Ru Campbell
Viktor Hedberg Viktor Hedberg
Profile icon Viktor Hedberg
View More author details

Table of Contents (33) Chapters

Preface 1. Part 1: Cyber Threats and Microsoft 365 Defender
2. Chapter 1: Microsoft and Modern Cybersecurity Threats 3. Chapter 2: Microsoft 365 Defender: The Big Picture 4. Part 2: Microsoft Defender for Endpoint
5. Chapter 3: The Fundamentals of Microsoft Defender for Endpoint 6. Chapter 4: Onboarding Windows Clients and Servers 7. Chapter 5: Getting Started with Microsoft Defender Antivirus for Windows 8. Chapter 6: Advanced Microsoft Defender Antivirus for Windows 9. Chapter 7: Managing Attack Surface Reduction for Windows 10. Chapter 8: Managing Additional Capabilities for Windows 11. Chapter 9: Onboarding and Managing macOS 12. Chapter 10: Onboarding and Managing Linux Servers 13. Chapter 11: Onboarding and Managing iOS and Android 14. Part 3: Microsoft Defender for Identity
15. Chapter 12: Deploying Microsoft Defender for Identity 16. Chapter 13: Managing Defender for Identity 17. Part 4: Microsoft Defender for Office 365
18. Chapter 14: Deploying Exchange Online Protection 19. Chapter 15: Deploying Defender for Office 365 20. Part 5: Microsoft Defender for Cloud Apps
21. Chapter 16: Implementing and Managing Microsoft Defender for Cloud Apps 22. Part 6: Proactive Security and Incident Response
23. Chapter 17: Maintaining Security Hygiene and Threat Awareness 24. Chapter 18: Extended Detection and Response with Microsoft 365 Defender 25. Chapter 19: Advanced Hunting with KQL 26. Chapter 20: Microsoft Sentinel Integration 27. Chapter 21: Understanding Microsoft 365 Defender APIs 28. Part 7: Glossary and Answers
29. Chapter 22: Glossary
30. Chapter 23: Answers 31. Index 32. Other Books You May Enjoy

Understanding Microsoft 365 Defender APIs

Application programming interfaces (APIs) are a way to programmatically connect applications to other applications. In the context of Microsoft 365 Defender, this could mean connecting your PowerShell scripts to query data; an independent software vendor (ISV) connecting to provide additional value in their tool; or using a service such as Azure Logic Apps to automate a workflow based on Microsoft 365 Defender triggers.

In this chapter, you’ll learn the fundamentals regarding APIs for Microsoft 365 Defender and its related services, such as MDE, MDO, MDA, and MDVM. Specifically, we’re going to cover the following:

  • The different APIs available, including their differences and when to use each
  • Accessing the APIs and their permissions
  • An example scenario, where we’ll use PowerShell to perform an MDE operation using APIs

Based on this chapter, you’ll start to think of your own creative possibilities...

Making sense of the different APIs

Microsoft has made five APIs available related to Microsoft 365 Defender and its associated services. Some of these APIs are exclusively related to Microsoft 365 Defender, and others are part of a broader collection. Let’s check them out.

Microsoft Graph security API

The Microsoft Graph security API is part of the Microsoft Graph API. Its production request URLs are found at graph.microsoft.com/v1.0/security and beta request URLs at graph.microsoft.com/beta/security, with the beta endpoint subject to change and therefore not recommended by Microsoft for production use.

Microsoft is investing heavily in Microsoft Graph, and it’s reasonable to say this should be your starting point and where to expect future investment. This means if an operation is available in the Microsoft Graph security API and another API, you may want to opt for the Graph version.

The following capabilities related to Microsoft 365 Defender are exposed...

Accessing the APIs

As APIs expose a lot of sensitive data and, in many cases, give you the ability to change significant settings, their exposure is protected by default. To get access, you’ll need to open up access, which is typically protected behind an access token or certificate.

For the APIs discussed in the last section, you’ll manage permissions to the APIs using Azure AD app registrations. So, we’ll guide you through creating an app registration, then use PowerShell as an example of using the APIs.

Creating an app registration for API access

As you create the app registration, you’ll get to choose which API permissions are exposed, then obtain the credentials to access those APIs. We’re going to use application permissions, which means they can run without a dedicated signed-in user (compared to delegated permissions, which access the API as an authenticated user).

To perform the following, you should be an Azure AD global administrator...

Summary

If you’re going to be managing multiple tenants, or want to otherwise programmatically manage as much as possible, you’re going to want to start mastering the APIs available for Microsoft 365 Defender and its associated services.

That’s why, in this chapter, you learned about the five main APIs available, and the kinds of operations each exposes:

  • The Microsoft Graph security API
  • Microsoft 365 Defender APIs
  • Microsoft Defender for Endpoint APIs
  • The Microsoft Defender for Cloud Apps API
  • The Office 365 Management Activity API

As a rule, if it’s in Microsoft Graph, use it there to centralize efforts and stick with where Microsoft appears to be focusing most. However, you’ll still find lots in the other APIs only. Most of the APIs focus on operations of Microsoft 365 Defender rather than settings management, but hopefully, we’ll see this change over time so more things can be automated and managed as code...

Challenges

Rather than have questions for this chapter like the others, we’ve posed two challenges that can be attempted using the APIs learned about in this chapter:

  1. Using an Azure Logic Apps app, try to update your team every time a new MDE alert is generated.
  2. You have several scripts you want to add to the live response library for multiple tenants. Try to upload these using PowerShell.

Further reading

To continue your learning path of the world of Microsoft 365 Defender APIs, you can refer to the following resources:

lock icon The rest of the chapter is locked
You have been reading a chapter from
Mastering Microsoft 365 Defender
Published in: Jul 2023 Publisher: Packt ISBN-13: 9781803241708
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}