Giter Site home page Giter Site logo

pscortex's Introduction

PowerShell Gallery Version PowerShell Gallery GitHub

PSCortex

Get endpoints, incidents and alerts from the Cortex XDR API.

Important

This module is no longer maintained.

Before you begin

First of all you have to obtain a API Key and API Key ID: Get Started with Cortex XDR APIs

Installation

Install-Module -Name PSCortex

Usage

Below are some examples of how you can use this module. Please use Get-Help for more details about each function.

Store API Key ID and API Key as $Credential and pass it to Initialize-CortexConfig.

$Credential = Get-Credential
Initialize-CortexConfig -TenantName yourcompany -SecurityLevel Advanced -Region EU -Credential $Credential

Get All Endpoints. Returns a list of all endpoints with a limited number of properties.

Get-CortexEndpointList

Get Endpoint where status is lost and Delete Endpoints. Running Get-CortexEndpoint without parameters will return all endpoints.

$LostEndpoints = Get-CortexEndpoint -EndpointStatus Lost
Remove-CortexEndpoint -EndpointId $LostEndpoints.EndpointId -WhatIf

Get Incidents. Running Get-CortexIncident without parameters will return all incidents.

Get-CortexIncident -Status New

Get Alerts. Running Get-CortexAlert without parameters will return all alerts.

Get-CortexAlert -Severity High

Get Audit Agent Report. Running Get-CortexAuditAgentReport without parameters will return all reports.

Get-CortexAuditAgentReport -Category Status

Get Audit Management Log. Running Get-CortexAuditManagementLog without parameters will return all logs.

Get-CortexAuditManagementLog -CreatedAfter (Get-Date).AddDays(-7)

Get Violations. Running Get-CortexViolation without parameters will return all violations.

Get-CortexViolation -CreatedAfter (Get-Date).AddDays(-7) -Type PortableDevice

Use Case: Find Duplicates

If a computer is reinstalled you could end up with duplicates in Cortex XDR.

Get-CortexEndpointList | Group-Object HostName | Where-Object Count -gt 1 | Select-Object -ExpandProperty Group

Use Case: Delete Endpoints that do not exist in AD

If the endpoint is uninstalled or lost and the computer no longer exist in AD you probably want to remove it from Cortex XDR.

$Endpoints = Get-CortexEndpointList -InactiveOnly | Where-Object HostName -notin (Get-ADComputer -Filter *).Name
Remove-CortexEndpoint -EndpointId $Endpoints.AgentId -WhatIf

pscortex's People

Contributors

lahell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.