Skip to content

Latest commit

 

History

History
111 lines (82 loc) · 3.6 KB

README.md

File metadata and controls

111 lines (82 loc) · 3.6 KB

SecureSpherePS

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

  • 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!