Skip to content

ℹ️ PowerShell Module to manage Imperva SecureSphere 13.6. Automate and control your Imperva WAF with PowerShell.

License

Notifications You must be signed in to change notification settings

akshinmustafayev/SecureSpherePS

Repository files navigation

SecureSpherePS

made-with-powershell License Total lines Downloads GitHub repo file count GitHub repo file count



image


📰 Description

SecureSpherePS - PowerShell Module to manage Imperva SecureSphere 13.6. Automate and control your Imperva SecureSphere Web Application Firewall with PowerShell.

image

🔧 Installation

Simple installation

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.

Advanced installation
  • 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 
    

    image

  • Load module using cmdlet:

    Import-Module SecureSpherePS
    

📋 Usage

# 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

📌 Example

$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
	}
}

image

📘 Documentation

List of available cmdlets is here.

🎯 Contribution

Contribution is very much appreciated. Hope that this module might be useful for you!

About

ℹ️ PowerShell Module to manage Imperva SecureSphere 13.6. Automate and control your Imperva WAF with PowerShell.

Resources

License

Code of conduct

Stars

Watchers

Forks