Powershell cmdlets for managed Aruba ClearPass (CPPM)
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Medias
PowerArubaCP
Tests
LICENSE
README.md

README.md

Last release: GitHub version

PowerArubaCP

This is a Powershell module for configure a Aruba ClearPass (CPPM).

With this module (version 0.1.0) you can manage:

  • Invoke API using Invoke-ArubaCPRestMethod

More functionality will be added later.

Tested with Aruba ClearPass (using release 6.7.x)

Usage

All resource management functions are available with the Powershell verbs GET, ADD, SET, REMOVE.

Requirements

  • Powershell 5 (If possible get the latest version)
  • A ClearPass (with release 6.7.x ) and API Client enable

Instructions

Install the module

# Automated installation (Powershell 5):
    Install-Module PowerArubaCP

# Import the module
    Import-Module PowerArubaCP

# Get commands in the module
    Get-Command -Module PowerArubaCP

# Get help
    Get-Help Connect-ArubaCP -Full

Examples

Connecting to the ClearPass using API

The first thing to do is to get API Client Token

Go on WebGUI of your ClearPass, on Guest Modules
Go on Adminstration => API Services => API Clients


Create a New API Client

  • Client ID : a client name (for example PowerArubaCP)
  • Operator Profile : Super Administrator
  • Grant type : Client credentials
  • Access Token Lifetime : You can increment ! (24 hours !)

Click on Create API Client (you don't need to store the Client Secet)

On API Clients List, select the your client

Click on Generate Access Token


And kept the token (for example : 70680f1d19f86110800d5d5cb4414fbde7be12ae)

After connect to a Aruba ClearPass with the command Connect-ArubaCP :

# Connect to the Aruba Clearpass
    Connect-ArubaCP 192.0.2.1 -token 70680f1d19f86110800d5d5cb4414fbde7be12ae

Invoke API

for example to get ClearPass version

# get ClearPass version using API
    Invoke-ArubaCPRestMethod -method "get" -uri "api/cppm-version"

    app_major_version   : 6
    app_minor_version   : 7
    app_service_release : 2
    app_build_number    : 105008
    hardware_version    : CLABV
    fips_enabled        : False
    eval_license        : False
    cloud_mode          : False

to get API uri, go to ClearPass Swagger (https://CPPM-IP/api-docs)

And choice a service (for example Platform)

Disconnecting

# Disconnect from the Aruba ClearPass
    Disconnect-ArubaCP

Author

Alexis La Goutte

Special Thanks

  • Warren F. for his blog post 'Building a Powershell module'
  • Erwan Quelin for help about Powershell

License

Copyright 2018 Alexis La Goutte and the community.