Cyber security

Defender-For-Cloud-Apps Toolbox : Powering Up Microsoft Cloud App Security With PowerShell

The Defender-for-Cloud-Apps Toolbox is a robust collection of PowerShell functions designed to streamline and automate the management of Microsoft Cloud App Security (MCAS).

By leveraging these tools, administrators can efficiently handle tasks such as managing blocklists, configuring IP ranges, and more. Below is a detailed overview of its features, functions, requirements, and usage.

Features

The toolbox offers the following key functionalities:

  • Export MCAS Blocklist: Export and manage blocklists from MCAS.
  • Export MCAS IP Ranges: Extract all IP ranges in a structured CSV format.
  • Get MCAS IP Ranges: Retrieve and list all existing IP ranges configured in MCAS.
  • Create New MCAS IP Ranges: Add new IP ranges with specified metadata.
  • Update Existing MCAS IP Ranges: Modify existing IP range details.
  • Remove MCAS IP Ranges: Delete specific IP ranges from MCAS.

Functions

  1. Export-MCASBlockList.ps1: Exports the current blocklist for review or archival purposes.
  2. Export-MCASIpRange.ps1: Outputs all configured IP ranges into a CSV file with metadata like names, categories, and tags.
  3. Get-MCASIPRanges.ps1: Lists all configured IP ranges with details such as subnets and tags.
  4. New-MCASIpRange.ps1: Adds new IP ranges to the configuration using specified parameters.
  5. Remove-MCASIPRange.ps1: Deletes specified IP ranges from the setup.
  6. Update-MCASIPRange.ps1: Updates metadata for existing IP ranges.

To use the toolbox:

  • PowerShell 5.1 (Windows) or 7.x (cross-platform) is required.
  • An Entra ID App Registration with API permissions for Discovery.manage, Settings.read, and Settings.manage.
  • Network access to the MCAS API endpoint.

To install, clone the repository:

git clone https://github.com/alexverboon/Defender-for-Cloud-Apps-Toolbox.git

Import the desired functions into your PowerShell session:

Import-Module .\FunctionName.ps1

Export All IP Ranges

.\Export-MCASIpRange.ps1 -McasPortalAPI "https://yourmcasapi.com" -Token "your_token" -OutputCsvFilePath "c:\Sampledata\mcas_export.csv"

Add a New IP Range

New-MCASIpRange -CsvFilePath "c:\sampledata\mcasip_new.csv" -McasPortalAPI "https://yourmcasapi.com" -Token $token

Remove an IP Range

Remove-MCASIPRange -CsvFilePath "C:\sampledata\mcasip_remove.csv" -McasPortalAPI "https://yourmcasapi.com" -Token $token

This toolbox simplifies administrative tasks in Microsoft Defender for Cloud Apps, enabling efficient management of security configurations through automation.

Varshini

Varshini is a Cyber Security expert in Threat Analysis, Vulnerability Assessment, and Research. Passionate about staying ahead of emerging Threats and Technologies.

Recent Posts

MassVulScan : A Comprehensive Network Scanning Tool

MassVulScan is a powerful network scanning tool designed for pentesters and system administrators to identify…

48 minutes ago

The-XSS-Rat : A Comprehensive Guide To Cross-Site Scripting Tools And Strategies

The-XSS-Rat, an experienced ethical hacker, provides valuable insights into the world of cross-site scripting (XSS)…

51 minutes ago

NimPlant C2 : A Position Independent Code (PIC) Beacon

NimPlant C2 is a minimal Proof-of-Concept (PoC) beacon written in C, designed to operate as…

3 days ago

EUD : Exploring Qualcomm’s Embedded USB Debugger

The Embedded USB Debugger (EUD) is a sophisticated tool developed by Qualcomm to enhance the…

3 days ago

Unleashed Recompiled : A Technical Deep Dive Into Sonic’s PC Transformation

Unleashed Recompiled is an unofficial PC port of Sonic Unleashed, created through the process of…

3 days ago

XenonRecomp : A Tool For Recompiling Xbox 360 Executables

XenonRecomp is a powerful tool designed to convert Xbox 360 executables into C++ code, allowing…

3 days ago