Public/Targets/Disable-SIASSHCAPublicKey.ps1
|
function Disable-SIASSHCAPublicKey { <# .SYNOPSIS Deactivates the previous SIA SSH CA key version. .DESCRIPTION Deactivates the SSH CA key version that was active before the most recent rotation. Run this only after every target host trusts the new key; sessions signed against the deactivated version will stop working. .EXAMPLE Disable-SIASSHCAPublicKey Deactivates the previous SSH CA key version. .INPUTS None. .OUTPUTS psSIA.SSHCAPublicKey .LINK https://api-docs.cyberark.com/secure-infra-access/docs/sia-ssh-public-keys-api #> [CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'High')] [OutputType('psSIA.SSHCAPublicKey')] param() if ($PSCmdlet.ShouldProcess('SIA SSH CA key', 'Deactivate previous version')) { Invoke-SIARequest -Method POST -Path '/api/public-keys/rotation/deactivate-previous' | ConvertFrom-SIAResponse -TypeName 'psSIA.SSHCAPublicKey' } } |