1
1
2
2
# PowerArubaCP
3
3
4
- This is a Powershell module for configure a Aruba ClearPass (CPPM).
5
-
6
- With this module (version 0.3.0) you can manage:
7
-
8
- - Network Device (Add / Get / Set / Remove a NAS)
4
+ This is a Powershell module for configure an Aruba ClearPass (CPPM).
5
+
6
+ With this module (version 0.4.0) you can manage:
7
+
8
+ - API Client (Add / Get / Remove)
9
+ - Application License (Add / Get / Remove)
10
+ - CPPM (Get Version)
11
+ - Endpoint (Add / Get / Set / Remove)
12
+ - [ Network Device] ( #NAS-Management ) (Add / Get / Set / Remove a NAS)
13
+ - Server (Get Configuration, Version)
14
+ - Service (Get / Enable / Disable)
15
+ - Static Host List ( Add / Get / Set / Remove a Static Host List and Add/Remove Member)
9
16
- Invoke API using Invoke-ArubaCPRestMethod
10
17
18
+ There is some extra feature
19
+ - [ Invoke API] ( #Invoke-API )
20
+ - [ Multi Connection] ( #MultiConnection )
21
+ - [ Filtering] ( #Filtering )
22
+
11
23
More functionality will be added later.
12
24
13
- Tested with Aruba ClearPass (using release 6.7.x and 6.8.x)
25
+ Tested with Aruba ClearPass (using release 6.7.x and 6.8.x)
26
+ Application Licence, Service and Static Host List are not supported on Clearpass < 6.8.0
14
27
15
28
# Usage
16
29
@@ -39,14 +52,18 @@ For example, you can manage NAS (NetworkDevice) with the following commands:
39
52
Get-Command -Module PowerArubaCP
40
53
41
54
# Get help
42
- Get-Help Add-ArubaCPArubaNetwork -Full
55
+ Get-Help Add-ArubaCPNetworkDevice -Full
43
56
```
44
57
45
58
# Examples
46
59
47
60
### Connecting to the ClearPass using API
48
61
49
- The first thing to do is to get API Client Token
62
+ The first thing to do is to get API Client
63
+ there is two methods to connect, using [ client_id/client_secret] ( #Use-API-client_idclient_secret ) or [ token] ( #Use-API-Token )
64
+
65
+ #### Use API client_id/client_secret
66
+
50
67
51
68
Go on WebGUI of your ClearPass, on Guest Modules
52
69
![ ] ( ./Medias/CPPM_Guest_API.PNG )
@@ -59,7 +76,25 @@ Create a `New API Client`
59
76
- Grant type : Client credentials
60
77
- Access Token Lifetime : You can increment ! (24 hours !)
61
78
62
- Click on ` Create API Client ` (you don't need to store the Client Secet)
79
+ Click on ` Create API Client `
80
+
81
+ ``` powershell
82
+ # Connect to the Aruba Clearpass using client_id/client_secret
83
+ Connect-ArubaCP 192.0.2.1 -client_id PowerArubaCP -client_secret QRFttyxOmWX3NopMIYzKysj30wvIMxAwB6kUy7uJc67B
84
+
85
+ Name Value
86
+ ---- -----
87
+ token 7aa3de0be5ea230ea92b6de0bafa14d7a76e2305
88
+ invokeParams {DisableKeepAlive, SkipCertificateCheck}
89
+ server 192.0.2.1
90
+ port 443
91
+ version 6.8.4
92
+
93
+ ```
94
+
95
+ #### Use API Token
96
+
97
+ Like for client_id/client_secret, generate a API Client but you don't need to store the Client Secret
63
98
64
99
On ` API Clients List ` , select the your client
65
100
![ ] ( ./Medias/CPPM_Generate_Access_Token.PNG )
@@ -70,12 +105,19 @@ Click on `Generate Access Token`
70
105
And kept the token (for example : 70680f1d19f86110800d5d5cb4414fbde7be12ae)
71
106
72
107
73
- After connect to a Aruba ClearPass with the command ` Connect-ArubaCP ` :
108
+ After connect to an Aruba ClearPass with the command ` Connect-ArubaCP ` :
74
109
75
110
``` powershell
76
- # Connect to the Aruba Clearpass
111
+ # Connect to the Aruba Clearpass using Token
77
112
Connect-ArubaCP 192.0.2.1 -token 70680f1d19f86110800d5d5cb4414fbde7be12ae
78
113
114
+ Name Value
115
+ ---- -----
116
+ token 70680f1d19f86110800d5d5cb4414fbde7be12ae
117
+ invokeParams {DisableKeepAlive, SkipCertificateCheck}
118
+ server 192.0.2.1
119
+ port 443
120
+ version 6.8.4
79
121
```
80
122
81
123
### Invoke API
@@ -150,6 +192,41 @@ You can create a new NAS `Add-ArubaCPNetworkDevice`, retrieve its information `G
150
192
$nad = Get-ArubaCPNetworkDevice -name SW1
151
193
$nad | Remove-ArubaCPNetworkDevice -noconfirm
152
194
```
195
+
196
+ ### MultiConnection
197
+
198
+ From release 0.4.0, it is possible to connect on same times to multi ClearPass
199
+ You need to use -connection parameter to cmdlet
200
+
201
+ For example to get Vlan Ports of 2 switchs
202
+
203
+ ``` powershell
204
+ # Connect to first ClearPass
205
+ $cppm1 = Connect-ArubaCP 192.0.2.1 -SkipCertificateCheck -DefaultConnection:$false
206
+
207
+ #DefaultConnection set to false is not mandatory but only don't set the connection info on global variable
208
+
209
+ # Connect to second ClearPass
210
+ $cppm2 = Connect-ArubaCP 192.0.2.1 -SkipCertificateCheck -DefaultConnection:$false
211
+
212
+ # Get Static Host List for first ClearPass
213
+ Get-ArubaCPStaticHostList -connection $cppm1 | Format-Table
214
+
215
+ id name description host_format host_type value _links
216
+ -- ---- ----------- ----------- --------- ----- ------
217
+ 3001 SHL-list-IPAddress list IPAddress @{self=}
218
+ ....
219
+ # Get Static Host List for first ClearPass
220
+ Get-ArubaCPStaticHostList -connection $cppm2 | Format-Table
221
+
222
+ id name description host_format host_type value _links
223
+ -- ---- ----------- ----------- --------- ----- ------
224
+ 3001 SHL-list-MACAddress list MACAddress @{self=}
225
+ ...
226
+
227
+ #Each cmdlet can use -connection parameter
228
+ ```
229
+
153
230
### Filtering
154
231
For ` Invoke-ArubaCPRestMethod ` , it is possible to use -filter parameter
155
232
You need to use ClearPass API syntax :
@@ -211,15 +288,43 @@ Try to connect using `Connect-ArubaCP -SkipCertificateCheck`
211
288
212
289
# List of available command
213
290
``` powershell
291
+ Add-ArubaCPApiClient
292
+ Add-ArubaCPApplicationLicense
293
+ Add-ArubaCPEndpoint
214
294
Add-ArubaCPNetworkDevice
295
+ Add-ArubaCPStaticHostList
296
+ Add-ArubaCPStaticHostListMember
297
+ Confirm-ArubaCPApiClient
298
+ Confirm-ArubaCPApplicationLicense
299
+ Confirm-ArubaCPEndpoint
215
300
Confirm-ArubaCPNetworkDevice
301
+ Confirm-ArubaCPService
302
+ Confirm-ArubaCPStaticHostList
216
303
Connect-ArubaCP
304
+ Disable-ArubaCPService
217
305
Disconnect-ArubaCP
306
+ Enable-ArubaCPService
307
+ Format-ArubaCPMacAddress
308
+ Get-ArubaCPApiClient
309
+ Get-ArubaCPApplicationLicense
310
+ Get-ArubaCPCPPMVersion
311
+ Get-ArubaCPEndpoint
218
312
Get-ArubaCPNetworkDevice
313
+ Get-ArubaCPServerConfiguration
314
+ Get-ArubaCPServerVersion
315
+ Get-ArubaCPService
316
+ Get-ArubaCPStaticHostList
219
317
Invoke-ArubaCPRestMethod
318
+ Remove-ArubaCPApiClient
319
+ Remove-ArubaCPApplicationLicense
320
+ Remove-ArubaCPEndpoint
220
321
Remove-ArubaCPNetworkDevice
322
+ Remove-ArubaCPStaticHostList
323
+ Remove-ArubaCPStaticHostListMember
221
324
Set-ArubaCPCipherSSL
325
+ Set-ArubaCPEndpoint
222
326
Set-ArubaCPNetworkDevice
327
+ Set-ArubaCPStaticHostList
223
328
Set-ArubaCPuntrustedSSL
224
329
Show-ArubaCPException
225
330
```
0 commit comments