<# .SYNOPSIS Ask Invardia for this install's SecurityInsight Pro licence, and install it once it is approved (#239). .DESCRIPTION The updater job does this on every update run. Run it by hand to ask now, to see where a request stands, or to ask again after a rejection: 1. When the install has no valid licence for its tenant, or the licence ends within 30 days, it asks Invardia (the tenant sent is the one in your sign-in's TOKEN, never a configured value). 2. While the request is open it checks Invardia -- never more often than Invardia allows (30 minutes). 3. An approved licence is verified OFFLINE (file checksum, signature, this tenant, dates, product) and only then installed with setup\Set-SILicense.ps1 as the Key Vault secret SI-License, and read back. Nothing here prints the pull token. A new tenant is approved by Invardia's owner, so the first answer is usually "waiting for Invardia"; run it again later (or let the updater job do it). .PARAMETER Status Show where the request stands, and change nothing. .PARAMETER Force Ask or check NOW: also after a rejection (otherwise not asked again for 7 days) and before the next check time. .PARAMETER VaultName Override the vault. Normally resolved from config\SecurityInsight.custom.ps1. .PARAMETER ContactEmail Who Invardia may contact about this request. Default: $global:SI_LicenseRequest_ContactEmail (not sent when unset). .PARAMETER Edition The edition asked for (optional). Default: $global:SI_LicenseRequest_Edition. .PARAMETER BaseUrl Default: $global:SI_LicenseRequest_BaseUrl, else https://invardia.com. .EXAMPLE .\Request-SILicense.ps1 # signs you in (Azure Cloud Shell, or the browser) -- no PowerShell module needed .EXAMPLE .\Request-SILicense.ps1 -Status .LINK https://invardia.com/docs/si/scripts/Request-SILicense/ .NOTES Requirements: PowerShell 7 (pwsh). Windows PowerShell 5.1 is refused at once (#Requires -Version 7.0). Role: Key Vault Secrets Officer -- on the SecurityInsight Key Vault Hosts: *.blob.core.windows.net, *.queue.core.windows.net, *.table.core.windows.net, *.vault.azure.net, 169.254.169.254, api.loganalytics.io, api.msrc.microsoft.com, api.security.microsoft.com, api.securitycenter.microsoft.com, api.securityplatform.microsoft.com, database.windows.net, entra.microsoft.com, graph.microsoft.com, invardia.com, licenses.nuget.org, login.microsoftonline.com, management.azure.com, monitor.azure.com, nvd.nist.gov, outlook.office.com, outlook.office365.com, portal.invardia.com, storage.azure.com, vault.azure.net #> [CmdletBinding(SupportsShouldProcess)] param( [switch]$Status, [switch]$Force, [string]$VaultName, [string]$ContactEmail, [string]$Edition, [string]$BaseUrl ) #Requires -Version 7.0 # SecurityInsight 3.0.79 -- Request-SILicense.ps1, standalone (Pro edition). Built 2026-11-09T20:28:39Z from commit c1472e2f4c240c971c9559f07eef7e794b322001, source SOLUTIONS/SecurityInsight/setup/Request-SILicense.ps1, # by release/Build-SISupportScripts.ps1 (framework SUPPORT-DL-1). Download: Invoke-WebRequest https://invardia.com/support/si/Request-SILicense.ps1 -OutFile Request-SILicense.ps1 # It carries the 109 SecurityInsight file(s) the script loads (listed in $__siSupportFiles below, readable, each line # prefixed with "|"); at run time it writes them to a private temporary folder, checks each SHA-256, runs the original # script from there with your parameters, and removes the folder. No PowerShell modules are needed. $script:SIScriptVersion = '3.0.79' # SI #547: the version this copy reports first (stamped into its embedded setup/_shared/SI-ScriptRun.ps1 too) $__siSupportVersion = '3.0.79' $__siSupportEntry = 'setup/Request-SILicense.ps1' $__siSupportFiles = [ordered]@{} $__siSupportFiles['setup/Request-SILicense.ps1'] = @{ Sha256 = 'c095ac80fa6c7e99ac66dcafd9d273e3278c8f70c3d2e8be60c881c63390bfdf'; Text = @' |<# |.SYNOPSIS | Ask Invardia for this install's SecurityInsight Pro licence, and install it once it is approved (#239). | |.DESCRIPTION | The updater job does this on every update run. Run it by hand to ask now, to see where a request stands, or to ask | again after a rejection: | | 1. When the install has no valid licence for its tenant, or the licence ends within 30 days, it asks Invardia | (the tenant sent is the one in your sign-in's TOKEN, never a configured value). | 2. While the request is open it checks Invardia -- never more often than Invardia allows (30 minutes). | 3. An approved licence is verified OFFLINE (file checksum, signature, this tenant, dates, product) and only then | installed with setup\Set-SILicense.ps1 as the Key Vault secret SI-License, and read back. | | Nothing here prints the pull token. A new tenant is approved by Invardia's owner, so the first answer is usually | "waiting for Invardia"; run it again later (or let the updater job do it). | |.PARAMETER Status | Show where the request stands, and change nothing. |.PARAMETER Force | Ask or check NOW: also after a rejection (otherwise not asked again for 7 days) and before the next check time. |.PARAMETER VaultName | Override the vault. Normally resolved from config\SecurityInsight.custom.ps1. |.PARAMETER ContactEmail | Who Invardia may contact about this request. Default: $global:SI_LicenseRequest_ContactEmail (not sent when unset). |.PARAMETER Edition | The edition asked for (optional). Default: $global:SI_LicenseRequest_Edition. |.PARAMETER BaseUrl | Default: $global:SI_LicenseRequest_BaseUrl, else https://invardia.com. |.EXAMPLE | .\Request-SILicense.ps1 # signs you in (Azure Cloud Shell, or the browser) -- no PowerShell module needed |.EXAMPLE | .\Request-SILicense.ps1 -Status | |.LINK | https://invardia.com/docs/si/scripts/Request-SILicense/ |#> |[CmdletBinding(SupportsShouldProcess)] |param( | [switch]$Status, | [switch]$Force, | [string]$VaultName, | [string]$ContactEmail, | [string]$Edition, | [string]$BaseUrl |) | |#Requires -Version 7.0 # after the help and the param block: before the help, it hides the help from Get-Help |# framework section 12.7 / 12.10: the documentation link first, a transcript of the run, -WhatIf writes nothing |. ([IO.Path]::Combine($PSScriptRoot, '_shared', 'SI-ScriptRun.ps1')) |$siRun = Start-SIScriptRun -Script 'Request-SILicense' -Quiet:($false) |if ($WhatIfPreference) { $Status = $true; Write-Host '-WhatIf: shows the licence request state only -- nothing is requested and no licence is installed.' -ForegroundColor Yellow } |try { |$ErrorActionPreference = 'Stop' |$siRoot = Split-Path -Parent $PSScriptRoot |. (Join-Path $siRoot 'auth\Get-SIVaultName.ps1') |. (Join-Path $siRoot 'engine\_shared\SI-LicenceRequest.ps1') |$mi = Join-Path $siRoot 'auth\SI-ManagedIdentity.ps1' |if (Test-Path -LiteralPath $mi) { . $mi } | |if (-not $VaultName) { | $cfg = Join-Path $siRoot 'config\SecurityInsight.custom.ps1' | if (Test-Path -LiteralPath $cfg) { try { . $cfg 3>$null } catch { Write-Warning ("config\SecurityInsight.custom.ps1 did not load cleanly: {0}" -f $_.Exception.Message) } } |} |$vault = Get-SIVaultName -VaultName $VaultName |# Azure over native REST, no PowerShell module (#305): the vault is read and written as the signed-in account (an existing |# sign-in in this process is reused; otherwise Azure Cloud Shell or the browser; a managed identity when the install runs as one). |if (-not (Get-Command -Name Get-SISetupAzureContext -ErrorAction SilentlyContinue)) { . ([IO.Path]::Combine($PSScriptRoot, '_shared', 'SI-SetupAzure.ps1')) } |if (-not [bool]$global:SI_UseManagedIdentity -and -not (Get-SISetupAzureContext)) { $null = Connect-SISetupAzure } |$seams = New-SILicenceRequestSeams -VaultName $vault -Mode Az -SIRoot $siRoot |# the tenant is the tid of the signed-in account's own ARM token (a managed identity: the identity endpoint's) |$seams.TenantId = { | if ([bool]$global:SI_UseManagedIdentity -and (Get-Command -Name Get-SIManagedIdentityToken -ErrorAction SilentlyContinue)) { | $null = Get-SIManagedIdentityToken -Resource 'https://management.azure.com/' | return [string]$global:SI_IdentityTokenTenantId | } | Get-SILicenceRequestTenantFromToken -AccessToken ([string](Get-SIAzureToken -Audience Arm)) |} |$seams.Log = { param($lvl, $t) if ($lvl -eq 'warn') { Write-Host "[WARN] $t" -ForegroundColor Yellow } else { Write-Host "[INFO] $t" -ForegroundColor Gray } } | |if ($Status) { | $s = Get-SILicenceRequestStatus -Json (& $seams.ReadSecret 'SI-LicenceRequest-State') | Write-Host ("[INFO] vault {0}: {1}" -f $vault, $s.Summary) | return $s |} | |if (-not $ContactEmail) { $ContactEmail = [string]$global:SI_LicenseRequest_ContactEmail } |if (-not $Edition) { $Edition = [string]$global:SI_LicenseRequest_Edition } |$version = ([IO.File]::ReadAllText((Join-Path $siRoot 'VERSION'))).Trim() |$r = Invoke-SILicenceRequest -Seams $seams -Version $version -BaseUrl $BaseUrl -ContactEmail $ContactEmail -Edition $Edition -Force:$Force |$color = switch ($r.Action) { 'installed' { 'Green' } { $_ -in 'none', 'waiting', 'knocked', 'pending' } { 'Gray' } default { 'Yellow' } } |Write-Host ("[{0}] {1}" -f $r.Action.ToUpperInvariant(), $r.Message) -ForegroundColor $color |$r |} finally { Stop-SIScriptRun -Run $siRun } '@ } $__siSupportFiles['setup/_shared/SI-ScriptRun.ps1'] = @{ Sha256 = 'a5c4d788d516521639611af43e1b88458216ce58bdb455885cac8e2a568afbd2'; Text = @' |#Requires -Version 5.1 |<# | EVERY SCRIPT A PERSON RUNS (framework DOCS/REQUIREMENTS.md section 12.7 SCRIPT-DOC-1 + section 12.10 SECURITY-PACK-1; SI #481 / #484). | One helper, called first by each such script: | | $siRun = Start-SIScriptRun -Script '