SecureSpherePS - PowerShell Module to manage Imperva SecureSphere 13.6. Automate and control your Imperva SecureSphere Web Application Firewall with PowerShell.
Open PowerShell as Administrator and execute the following command:
Install-Module -Name SecureSpherePS
Note: There must be access to internet, in order to download module from the PowerShell gallery.
-
Download the latest release or use direct link SecureSpherePS.zip.
-
Create folder SecureSpherePS in C:\Program Files\WindowsPowerShell\Modules directory.
-
Extract contents of ZIP archive to C:\Program Files\WindowsPowerShell\Modules\SecureSpherePS folder.
-
Run Windows PowerShell as Administrator.
-
Set execution policy using cmdlet:
Set-ExecutionPolicy Bypass
-
Load module using cmdlet:
Import-Module SecureSpherePS
# First we load the module
Import-Module SecureSpherePS
# Then we Set a SecureSphere server where we want to connect
Set-SecureSphereServer -Server "https://mxserver01:8083"
# Then we connect to server using login and password
New-SecureSphereSession -Login "administrator" -Password "some_cool_password"
To get a list of all available commands use:
Get-Command -Module SecureSpherePS
To get help for the command:
# Specify cmdlet name from the list
Get-Help Get-SecureSphereAllMXs -Full
$SitesObject = Get-SecureSphereAllSites
$Sites = $SitesObject.sites
foreach ($Site in $Sites)
{
$ServerGroupsObject = Get-SecureSphereAllServerGroups -SiteName $Site
$ServerGroups = $ServerGroupsObject.'server-groups'
foreach ($ServerGroup in $ServerGroups)
{
$ServerGroupItem = Get-SecureSphereServerGroup -SiteName $Site -ServerGroupName $ServerGroup
Write-Host "Operation mode of the " -NoNewline
Write-Host "$($ServerGroupItem.name)" -ForegroundColor Green -NoNewline
Write-Host " in site " -NoNewline
Write-Host "$Site" -ForegroundColor Green -NoNewline
Write-Host " which is located in group " -NoNewline
Write-Host "$ServerGroup" -ForegroundColor Green -NoNewline
Write-Host " is: " -NoNewline
Write-Host "$($ServerGroupItem.operationMode)" -ForegroundColor Green
}
}
List of available cmdlets is here.
Contribution is very much appreciated. Hope that this module might be useful for you!