diff --git a/VenafiPS/VenafiPS.psd1 b/VenafiPS/VenafiPS.psd1 index a2f4a379..0ce9c658 100644 --- a/VenafiPS/VenafiPS.psd1 +++ b/VenafiPS/VenafiPS.psd1 @@ -3,7 +3,7 @@ # # Generated by: Greg Brownstein # -# Generated on: 11/9/2021 +# Generated on: 11/27/2021 # @{ @@ -12,7 +12,7 @@ RootModule = 'VenafiPS.psm1' # Version number of this module. -ModuleVersion = '3.4' +ModuleVersion = '3.4.0' # Supported PSEditions # CompatiblePSEditions = @() @@ -69,28 +69,28 @@ PowerShellVersion = '5.1' # NestedModules = @() # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. -FunctionsToExport = 'Add-TppCertificateAssociation', 'ConvertTo-TppGuid', - 'ConvertTo-TppPath', 'Export-VenafiCertificate', - 'Find-TppCertificate', 'Find-TppCodeSignEnvironment', - 'Find-TppCodeSignProject', 'Find-TppCodeSignTemplate', - 'Find-TppIdentity', 'Find-TppObject', 'Get-TppAttribute', - 'Get-TppClassAttribute', 'Get-TppCodeSignConfig', - 'Get-TppCodeSignEnvironment', 'Get-TppCodeSignProject', - 'Get-TppCustomField', 'Get-TppIdentity', 'Get-TppIdentityAttribute', - 'Get-TppObject', 'Get-TppPermission', 'Get-TppSystemStatus', - 'Get-TppVersion', 'Get-TppWorkflowTicket', 'Get-VaasApplication', - 'Get-VaasOrgUnit', 'Get-VenafiCertificate', 'Import-TppCertificate', - 'Invoke-TppCertificatePush', 'Invoke-TppCertificateRenewal', - 'Invoke-VenafiRestMethod', 'Move-TppObject', 'New-TppCapiApplication', - 'New-TppCertificate', 'New-TppCodeSignProject', 'New-TppDevice', - 'New-TppObject', 'New-TppPolicy', 'New-TppToken', 'New-VenafiSession', - 'Read-TppLog', 'Remove-TppCertificate', - 'Remove-TppCertificateAssociation', 'Remove-TppCodeSignEnvironment', - 'Remove-TppCodeSignProject', 'Remove-TppPermission', - 'Rename-TppObject', 'Revoke-TppCertificate', 'Revoke-TppToken', - 'Set-TppAttribute', 'Set-TppCodeSignProjectStatus', - 'Set-TppPermission', 'Set-TppWorkflowTicketStatus', 'Test-ModuleHash', - 'Test-TppIdentity', 'Test-TppObject', 'Test-TppToken', 'Write-TppLog', 'Invoke-VenafiCertificateAction' +FunctionsToExport = 'Add-TppCertificateAssociation', 'ConvertTo-TppGuid', + 'ConvertTo-TppPath', 'Export-VenafiCertificate', + 'Find-TppCertificate', 'Find-TppCodeSignEnvironment', + 'Find-TppCodeSignProject', 'Find-TppCodeSignTemplate', + 'Find-TppIdentity', 'Find-TppObject', 'Get-TppAttribute', + 'Get-TppClassAttribute', 'Get-TppCodeSignConfig', + 'Get-TppCodeSignEnvironment', 'Get-TppCodeSignProject', + 'Get-TppCustomField', 'Get-TppIdentity', 'Get-TppIdentityAttribute', + 'Get-TppObject', 'Get-TppPermission', 'Get-TppSystemStatus', + 'Get-TppVersion', 'Get-TppWorkflowTicket', 'Get-VaasApplication', + 'Get-VaasOrgUnit', 'Get-VenafiCertificate', 'Import-TppCertificate', + 'Invoke-TppCertificatePush', 'Invoke-TppCertificateRenewal', + 'Invoke-VenafiCertificateAction', 'Invoke-VenafiRestMethod', + 'Move-TppObject', 'New-TppCapiApplication', 'New-TppCertificate', + 'New-TppCodeSignProject', 'New-TppDevice', 'New-TppObject', + 'New-TppPolicy', 'New-TppToken', 'New-VenafiSession', 'Read-TppLog', + 'Remove-TppCertificate', 'Remove-TppCertificateAssociation', + 'Remove-TppCodeSignEnvironment', 'Remove-TppCodeSignProject', + 'Remove-TppPermission', 'Rename-TppObject', 'Revoke-TppCertificate', + 'Revoke-TppToken', 'Set-TppAttribute', 'Set-TppCodeSignProjectStatus', + 'Set-TppPermission', 'Set-TppWorkflowTicketStatus', 'Test-ModuleHash', + 'Test-TppIdentity', 'Test-TppObject', 'Test-TppToken', 'Write-TppLog' # Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. CmdletsToExport = @() diff --git a/docs/changelog.md b/docs/changelog.md index 4eade045..8245e134 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,3 +1,11 @@ +## 3.4.0 +- Add `-All` option to `Get-TppAttribute` to get ALL effective attribute values for an object. This will provide the values as well as the path where the policy was applied +- Add getting policies (policy attributes) with `Get-TppAttribute` +- Add setting policies (policy attributes) with `Set-TppAttribute` +- Add `Invoke-VenafiCertificateAction`. This is your one stop shop for certificate actions on TPP or VaaS. You can Retire, Reset, Renew, Push, Validate, or Revoke. +- Cleanup output and verbose logging with `Remove-TppCertificate` +- Fix parameter set issue in `New-VenafiSession`, ensure version and custom field info retrieval doesn't occur when creating a VaaS session + ## 3.3.1 - Remove validation/limitation from `Get-TppCustomField` to only retrieve classes of type X509 Certificate and Device - Retrieve Application Base custom fields during `New-VenafiSession` diff --git a/docs/functions/Get-TppAttribute.md b/docs/functions/Get-TppAttribute.md index 78d0d583..a668ac13 100644 --- a/docs/functions/Get-TppAttribute.md +++ b/docs/functions/Get-TppAttribute.md @@ -1,42 +1,50 @@ # Get-TppAttribute ## SYNOPSIS -Get attributes for a given object +Get object attributes as well as policies (policy attributes) ## SYNTAX ### ByPath (Default) ``` -Get-TppAttribute -Path [-Attribute ] [-VenafiSession ] [] +Get-TppAttribute -Path [-Attribute ] [-VenafiSession ] [] ``` -### AllByPath +### PolicyPath ``` -Get-TppAttribute -Path [-VenafiSession ] [] +Get-TppAttribute -Path -Attribute [-Policy] -ClassName + [-VenafiSession ] [] +``` + +### AllEffectivePath +``` +Get-TppAttribute -Path [-All] [-VenafiSession ] [] ``` ### EffectiveByPath ``` -Get-TppAttribute -Path -Attribute [-Effective] [-VenafiSession ] +Get-TppAttribute -Path -Attribute [-Effective] [-VenafiSession ] [] ``` ### ByGuid ``` -Get-TppAttribute -Guid [-Attribute ] [-VenafiSession ] [] +Get-TppAttribute -Guid [-Attribute ] [-VenafiSession ] [] ``` ### EffectiveByGuid ``` -Get-TppAttribute -Guid -Attribute [-Effective] [-VenafiSession ] +Get-TppAttribute -Guid -Attribute [-Effective] [-VenafiSession ] [] ``` ## DESCRIPTION -Retrieves object attributes. +Retrieves object attributes as well as policies (aka policy attributes). You can either retrieve all attributes or individual ones. By default, the attributes returned are not the effective policy, but that can be requested with the -EffectivePolicy switch. +Effective switch. +Policy folders can have attributes as well as policies which apply to the resultant objects. +For more info on policies and how they are different than attributes, see https://docs.venafi.com/Docs/current/TopNav/Content/Policies/c_policies_tpp.php. ## EXAMPLES @@ -45,21 +53,35 @@ EffectivePolicy switch. Get-TppAttribute -Path '\VED\Policy\My Folder\myapp.company.com' ``` -Retrieve all configurations for a certificate +Retrieve all values for an object, excluding values assigned by policy ### EXAMPLE 2 ``` -Get-TppAttribute -Path '\VED\Policy\My Folder\myapp.company.com' -EffectivePolicy +Get-TppAttribute -Path '\VED\Policy\My Folder\myapp.company.com' -AttributeName 'driver name' ``` -Retrieve all effective configurations for a certificate +Retrieve the value for a specific attribute ### EXAMPLE 3 ``` -Get-TppAttribute -Path '\VED\Policy\My Folder\myapp.company.com' -AttributeName 'driver name' +Get-TppAttribute -Path '\VED\Policy\My Folder\myapp.company.com' -AttributeName 'Contact' -Effective ``` -Retrieve all the value for attribute driver name from certificate myapp.company.com +Retrieve the effective value for a specific attribute + +### EXAMPLE 4 +``` +Get-TppAttribute -Path '\VED\Policy\My Folder\myapp.company.com' -All +``` + +Retrieve all effective values for an object + +### EXAMPLE 5 +``` +Get-TppAttribute -Path '\VED\Policy\My Folder' -Policy -Class 'X509 Certificate' -AttributeName 'Contact' +``` + +Retrieve the policy attribute value for the specified policy folder ## PARAMETERS @@ -68,8 +90,20 @@ Path to the object to retrieve configuration attributes. Just providing DN will return all attributes. ```yaml -Type: String[] -Parameter Sets: ByPath, AllByPath, EffectiveByPath +Type: String +Parameter Sets: ByPath, EffectiveByPath +Aliases: DN + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +```yaml +Type: String +Parameter Sets: PolicyPath, AllEffectivePath Aliases: DN Required: True @@ -80,11 +114,12 @@ Accept wildcard characters: False ``` ### -Guid +To be deprecated; use -Path instead. Object Guid. Just providing Guid will return all attributes. ```yaml -Type: Guid[] +Type: Guid Parameter Sets: ByGuid, EffectiveByGuid Aliases: @@ -112,7 +147,7 @@ Accept wildcard characters: False ```yaml Type: String[] -Parameter Sets: EffectiveByPath, EffectiveByGuid +Parameter Sets: PolicyPath, EffectiveByPath, EffectiveByGuid Aliases: Required: True @@ -123,7 +158,8 @@ Accept wildcard characters: False ``` ### -Effective -Get the effective values of the attribute +Get the objects attribute value, once policies have been applied. +This is not applicable to policies, only objects. ```yaml Type: SwitchParameter @@ -137,6 +173,56 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -All +Get all effective object attribute values. +This will perform 3 steps, get the object type, enumerate the attributes for the object type, and get all the effective values. +The output will contain the path where the policy was applied from. +Note, expect this to take longer than usual given the number of api calls. + +```yaml +Type: SwitchParameter +Parameter Sets: AllEffectivePath +Aliases: + +Required: True +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Policy +Get policies (aka policy attributes) instead of object attributes + +```yaml +Type: SwitchParameter +Parameter Sets: PolicyPath +Aliases: + +Required: True +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ClassName +Required when getting policy attributes. +Provide the class name to retrieve the value for. +If unsure of the class name, add the value through the TPP UI and go to Support-\>Policy Attributes to find it. + +```yaml +Type: String +Parameter Sets: PolicyPath +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -VenafiSession Session object created from New-VenafiSession method. The value defaults to the script session object $VenafiSession. @@ -158,10 +244,15 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS -### Path, Guid +### Path ## OUTPUTS -### PSCustomObject with properties Name, Value, IsCustomField, and CustomName +### PSCustomObject with properties: +### - Name +### - Value +### - PolicyPath (only applicable with -All) +### - IsCustomField (not applicable to policies) +### - CustomName (not applicable to policies) ## NOTES ## RELATED LINKS @@ -170,9 +261,9 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable [https://github.com/gdbarron/VenafiPS/blob/main/VenafiPS/Public/Get-TppAttribute.ps1](https://github.com/gdbarron/VenafiPS/blob/main/VenafiPS/Public/Get-TppAttribute.ps1) -[https://docs.venafi.com/Docs/20.4SDK/TopNav/Content/SDK/WebSDK/r-SDK-POST-Config-read.php?tocpath=Web%20SDK%7CConfig%20programming%20interface%7C_____27](https://docs.venafi.com/Docs/20.4SDK/TopNav/Content/SDK/WebSDK/r-SDK-POST-Config-read.php?tocpath=Web%20SDK%7CConfig%20programming%20interface%7C_____27) +[https://docs.venafi.com/Docs/current/TopNav/Content/SDK/WebSDK/r-SDK-POST-Config-read.php](https://docs.venafi.com/Docs/current/TopNav/Content/SDK/WebSDK/r-SDK-POST-Config-read.php) -[https://docs.venafi.com/Docs/20.4SDK/TopNav/Content/SDK/WebSDK/r-SDK-POST-Config-readall.php?tocpath=Web%20SDK%7CConfig%20programming%20interface%7C_____28](https://docs.venafi.com/Docs/20.4SDK/TopNav/Content/SDK/WebSDK/r-SDK-POST-Config-readall.php?tocpath=Web%20SDK%7CConfig%20programming%20interface%7C_____28) +[https://docs.venafi.com/Docs/current/TopNav/Content/SDK/WebSDK/r-SDK-POST-Config-readall.php](https://docs.venafi.com/Docs/current/TopNav/Content/SDK/WebSDK/r-SDK-POST-Config-readall.php) -[https://docs.venafi.com/Docs/20.4SDK/TopNav/Content/SDK/WebSDK/r-SDK-POST-Config-readeffectivepolicy.php?tocpath=Web%20SDK%7CConfig%20programming%20interface%7C_____31](https://docs.venafi.com/Docs/20.4SDK/TopNav/Content/SDK/WebSDK/r-SDK-POST-Config-readeffectivepolicy.php?tocpath=Web%20SDK%7CConfig%20programming%20interface%7C_____31) +[https://docs.venafi.com/Docs/current/TopNav/Content/SDK/WebSDK/r-SDK-POST-Config-readeffectivepolicy.php](https://docs.venafi.com/Docs/current/TopNav/Content/SDK/WebSDK/r-SDK-POST-Config-readeffectivepolicy.php) diff --git a/docs/functions/Get-VenafiCertificate.md b/docs/functions/Get-VenafiCertificate.md index e14e81fe..87f8edcc 100644 --- a/docs/functions/Get-VenafiCertificate.md +++ b/docs/functions/Get-VenafiCertificate.md @@ -61,6 +61,13 @@ Get-VenafiCertificate -CertificateId '\ved\policy\mycert.com' -IncludePreviousVe Get certificate info for a specific cert on TPP, including historical versions of the certificate that are not revoked or expired. +### EXAMPLE 6 +``` +Find-TppCertificate | Get-VenafiCertificate +``` + +Get certificate info for all certs in TPP + ## PARAMETERS ### -CertificateId diff --git a/docs/functions/Invoke-VenafiCertificateAction.md b/docs/functions/Invoke-VenafiCertificateAction.md new file mode 100644 index 00000000..c6de98a4 --- /dev/null +++ b/docs/functions/Invoke-VenafiCertificateAction.md @@ -0,0 +1,271 @@ +# Invoke-VenafiCertificateAction + +## SYNOPSIS +Perform an action against a certificate on TPP or VaaS + +## SYNTAX + +### Retire +``` +Invoke-VenafiCertificateAction -CertificateId [-Retire] [-AdditionalParameters ] + [-VenafiSession ] [-WhatIf] [-Confirm] [] +``` + +### Reset +``` +Invoke-VenafiCertificateAction -CertificateId [-Reset] [-AdditionalParameters ] + [-VenafiSession ] [-WhatIf] [-Confirm] [] +``` + +### Renew +``` +Invoke-VenafiCertificateAction -CertificateId [-Renew] [-AdditionalParameters ] + [-VenafiSession ] [-WhatIf] [-Confirm] [] +``` + +### Push +``` +Invoke-VenafiCertificateAction -CertificateId [-Push] [-AdditionalParameters ] + [-VenafiSession ] [-WhatIf] [-Confirm] [] +``` + +### Validate +``` +Invoke-VenafiCertificateAction -CertificateId [-Validate] [-AdditionalParameters ] + [-VenafiSession ] [-WhatIf] [-Confirm] [] +``` + +### Revoke +``` +Invoke-VenafiCertificateAction -CertificateId [-Revoke] [-AdditionalParameters ] + [-VenafiSession ] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +One stop shop for basic certificate actions against either TPP or VaaS. +When supported by the platform, you can Retire, Reset, Renew, Push, Validate, or Revoke. + +## EXAMPLES + +### EXAMPLE 1 +``` +Invoke-VenafiCertificateAction -CertificateId '\VED\Policy\My folder\app.mycompany.com' -Revoke +``` + +Perform an action + +### EXAMPLE 2 +``` +Invoke-VenafiCertificateAction -CertificateId '\VED\Policy\My folder\app.mycompany.com' -Revoke -AdditionalParameters @{'Comments'='Key compromised'} +``` + +Perform an action sending additional parameters. + +## PARAMETERS + +### -CertificateId +Certificate identifier. +For Venafi as a Service, this is the unique guid. +For TPP, use the full path. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: Path + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### -Retire +Retire/disable a certificate + +```yaml +Type: SwitchParameter +Parameter Sets: Retire +Aliases: + +Required: True +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Reset +Reset the state of a certificate and its associated applications. +TPP only. + +```yaml +Type: SwitchParameter +Parameter Sets: Reset +Aliases: + +Required: True +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Renew +Requests immediate renewal for an existing certificate + +```yaml +Type: SwitchParameter +Parameter Sets: Renew +Aliases: + +Required: True +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Push +Provisions the same certificate and private key to one or more devices or servers. +The certificate must be associated with one or more Application objects. +TPP only. + +```yaml +Type: SwitchParameter +Parameter Sets: Push +Aliases: + +Required: True +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Validate +Initiates SSL/TLS network validation + +```yaml +Type: SwitchParameter +Parameter Sets: Validate +Aliases: + +Required: True +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Revoke +Sends a revocation request to the certificate CA. +TPP only. + +```yaml +Type: SwitchParameter +Parameter Sets: Revoke +Aliases: + +Required: True +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AdditionalParameters +Additional items specific to the action being taken, if needed. +See the api documentation for appropriate items, many are in the links in this help. + +```yaml +Type: Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -VenafiSession +Session object created from New-VenafiSession method. +The value defaults to the script session object $VenafiSession. + +```yaml +Type: VenafiSession +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: $script:VenafiSession +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### CertificateId +## OUTPUTS + +### PSCustomObject with the following properties: +### CertificateId - Certificate path (TPP) or Guid (VaaS) +### Success - A value of true indicates that the action was successful +### Error - Indicates any errors that occurred. Not returned when Success is true +## NOTES + +## RELATED LINKS + +[http://VenafiPS.readthedocs.io/en/latest/functions/Invoke-TppCertificateRenewal/](http://VenafiPS.readthedocs.io/en/latest/functions/Invoke-TppCertificateRenewal/) + +[https://github.com/gdbarron/VenafiPS/blob/main/VenafiPS/Public/Invoke-TppCertificateRenewal.ps1](https://github.com/gdbarron/VenafiPS/blob/main/VenafiPS/Public/Invoke-TppCertificateRenewal.ps1) + +[https://docs.venafi.com/Docs/current/TopNav/Content/SDK/WebSDK/r-SDK-POST-Certificates-Reset.php](https://docs.venafi.com/Docs/current/TopNav/Content/SDK/WebSDK/r-SDK-POST-Certificates-Reset.php) + +[https://docs.venafi.com/Docs/current/TopNav/Content/SDK/WebSDK/r-SDK-POST-Certificates-renew.php](https://docs.venafi.com/Docs/current/TopNav/Content/SDK/WebSDK/r-SDK-POST-Certificates-renew.php) + +[https://docs.venafi.com/Docs/current/TopNav/Content/SDK/WebSDK/r-SDK-POST-Certificates-Push.php](https://docs.venafi.com/Docs/current/TopNav/Content/SDK/WebSDK/r-SDK-POST-Certificates-Push.php) + +[https://docs.venafi.com/Docs/current/TopNav/Content/SDK/WebSDK/r-SDK-POST-Certificates-Validate.php](https://docs.venafi.com/Docs/current/TopNav/Content/SDK/WebSDK/r-SDK-POST-Certificates-Validate.php) + +[https://docs.venafi.com/Docs/current/TopNav/Content/SDK/WebSDK/r-SDK-POST-Certificates-revoke.php](https://docs.venafi.com/Docs/current/TopNav/Content/SDK/WebSDK/r-SDK-POST-Certificates-revoke.php) + +[https://api.venafi.cloud/webjars/swagger-ui/index.html?configUrl=%2Fv3%2Fapi-docs%2Fswagger-config&urls.primaryName=outagedetection-service](https://api.venafi.cloud/webjars/swagger-ui/index.html?configUrl=%2Fv3%2Fapi-docs%2Fswagger-config&urls.primaryName=outagedetection-service) + diff --git a/docs/functions/New-VenafiSession.md b/docs/functions/New-VenafiSession.md index fdf3c671..ce4fcb79 100644 --- a/docs/functions/New-VenafiSession.md +++ b/docs/functions/New-VenafiSession.md @@ -7,70 +7,67 @@ Create a new Venafi TPP or Venafi as a Service session ### KeyIntegrated (Default) ``` -New-VenafiSession -Server [-PassThru] [-WhatIf] [-Confirm] [] +New-VenafiSession -Server [-PassThru] [] ``` ### VaultRefreshToken ``` New-VenafiSession [-Server ] [-ClientId ] [-Scope ] -VaultRefreshTokenName - [-VaultMetadata] [-PassThru] [-WhatIf] [-Confirm] [] + [-VaultMetadata] [-PassThru] [] ``` ### VaultAccessToken ``` New-VenafiSession [-Server ] [-Scope ] -VaultAccessTokenName [-VaultMetadata] - [-PassThru] [-WhatIf] [-Confirm] [] + [-PassThru] [] ``` ### RefreshToken ``` New-VenafiSession -Server -ClientId -RefreshToken - [-VaultRefreshTokenName ] [-VaultMetadata] [-AuthServer ] [-PassThru] [-WhatIf] [-Confirm] - [] + [-VaultRefreshTokenName ] [-VaultMetadata] [-AuthServer ] [-PassThru] [] ``` ### AccessToken ``` New-VenafiSession -Server -AccessToken [-VaultAccessTokenName ] - [-VaultMetadata] [-PassThru] [-WhatIf] [-Confirm] [] + [-VaultMetadata] [-PassThru] [] ``` ### TokenCertificate ``` New-VenafiSession -Server -ClientId -Scope -Certificate [-VaultAccessTokenName ] [-VaultRefreshTokenName ] [-VaultMetadata] [-AuthServer ] - [-PassThru] [-WhatIf] [-Confirm] [] + [-PassThru] [] ``` ### TokenIntegrated ``` New-VenafiSession -Server -ClientId -Scope [-State ] [-VaultAccessTokenName ] [-VaultRefreshTokenName ] [-VaultMetadata] [-AuthServer ] - [-PassThru] [-WhatIf] [-Confirm] [] + [-PassThru] [] ``` ### TokenOAuth ``` New-VenafiSession -Server -Credential -ClientId -Scope [-State ] [-VaultAccessTokenName ] [-VaultRefreshTokenName ] [-VaultMetadata] - [-AuthServer ] [-PassThru] [-WhatIf] [-Confirm] [] + [-AuthServer ] [-PassThru] [] ``` ### KeyCredential ``` -New-VenafiSession -Server -Credential [-PassThru] [-WhatIf] [-Confirm] - [] +New-VenafiSession -Server -Credential [-PassThru] [] ``` ### Vaas ``` -New-VenafiSession -VaasKey [-VaultVaasKeyName ] [-PassThru] [-WhatIf] [-Confirm] - [] +New-VenafiSession -VaasKey [-VaultVaasKeyName ] [-PassThru] [] ``` ### VaultVaasKey ``` -New-VenafiSession -VaultVaasKeyName [-PassThru] [-WhatIf] [-Confirm] [] +New-VenafiSession -VaultVaasKeyName [-PassThru] [] ``` ## DESCRIPTION @@ -484,37 +481,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: wi - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Confirm -Prompts you for confirmation before running the cmdlet. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: cf - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### CommonParameters This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). diff --git a/docs/functions/Remove-TppCertificate.md b/docs/functions/Remove-TppCertificate.md index fa85522d..d482c05f 100644 --- a/docs/functions/Remove-TppCertificate.md +++ b/docs/functions/Remove-TppCertificate.md @@ -5,15 +5,8 @@ Remove a certificate ## SYNTAX -### ByObject ``` -Remove-TppCertificate -InputObject [-Force] [-VenafiSession ] [-WhatIf] [-Confirm] - [] -``` - -### ByPath -``` -Remove-TppCertificate -Path [-Force] [-VenafiSession ] [-WhatIf] [-Confirm] +Remove-TppCertificate [-Path] [-Force] [[-VenafiSession] ] [-WhatIf] [-Confirm] [] ``` @@ -48,33 +41,18 @@ Remove a certificate and automatically remove all associations ## PARAMETERS -### -InputObject -TppObject which represents a unique object - -```yaml -Type: TppObject -Parameter Sets: ByObject -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: True (ByValue) -Accept wildcard characters: False -``` - ### -Path Path to the certificate to remove ```yaml Type: String -Parameter Sets: ByPath +Parameter Sets: (All) Aliases: DN, CertificateDN Required: True -Position: Named +Position: 1 Default value: None -Accept pipeline input: True (ByValue) +Accept pipeline input: True (ByPropertyName, ByValue) Accept wildcard characters: False ``` @@ -103,7 +81,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: Named +Position: 2 Default value: $script:VenafiSession Accept pipeline input: False Accept wildcard characters: False @@ -157,5 +135,5 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable [https://github.com/gdbarron/VenafiPS/blob/main/VenafiPS/Public/Remove-TppCertificate.ps1](https://github.com/gdbarron/VenafiPS/blob/main/VenafiPS/Public/Remove-TppCertificate.ps1) -[https://docs.venafi.com/Docs/20.4SDK/TopNav/Content/SDK/WebSDK/r-SDK-DELETE-Certificates-Guid.php?tocpath=Web%20SDK%7CCertificates%20programming%20interface%7C_____9](https://docs.venafi.com/Docs/20.4SDK/TopNav/Content/SDK/WebSDK/r-SDK-DELETE-Certificates-Guid.php?tocpath=Web%20SDK%7CCertificates%20programming%20interface%7C_____9) +[https://docs.venafi.com/Docs/current/TopNav/Content/SDK/WebSDK/r-SDK-DELETE-Certificates-Guid.php](https://docs.venafi.com/Docs/current/TopNav/Content/SDK/WebSDK/r-SDK-DELETE-Certificates-Guid.php) diff --git a/docs/functions/Set-TppAttribute.md b/docs/functions/Set-TppAttribute.md index 00feaa6d..6cd1404d 100644 --- a/docs/functions/Set-TppAttribute.md +++ b/docs/functions/Set-TppAttribute.md @@ -1,41 +1,63 @@ # Set-TppAttribute ## SYNOPSIS -Sets a value on an attribute +Sets a value on an objects attribute or policies (policy attributes) ## SYNTAX +### Object ``` -Set-TppAttribute [-Path] [-Attribute] [-BypassValidation] - [[-VenafiSession] ] [-WhatIf] [-Confirm] [] +Set-TppAttribute -Path -Attribute [-BypassValidation] [-VenafiSession ] + [-WhatIf] [-Confirm] [] +``` + +### Policy +``` +Set-TppAttribute -Path -Attribute [-Policy] -ClassName [-Lock] + [-VenafiSession ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION -Set a value on an attribute. +Set the value on an objects attribute. The attribute can either be built-in or custom. +You can also set policies (policy attributes). ## EXAMPLES ### EXAMPLE 1 ``` -Set-TppAttribute -Path '\VED\Policy\My Folder\app.company.com -Attribute @{'My custom field Label'='new custom value'} +Set-TppAttribute -Path '\VED\Policy\My Folder\app.company.com' -Attribute @{'Consumers'='\VED\Policy\myappobject.company.com'} ``` -Set value on custom field +Set a value on an object ### EXAMPLE 2 ``` -Set-TppAttribute -Path '\VED\Policy\My Folder\app.company.com -Attribute @{'DateField'='hi'} -BypassValidation +Set-TppAttribute -Path '\VED\Policy\My Folder\app.company.com' -Attribute @{'My custom field Label'='new custom value'} ``` -Set value on custom field bypassing field validation +Set value on custom field ### EXAMPLE 3 ``` -Set-TppAttribute -Path '\VED\Policy\My Folder\app.company.com -Attribute @{'Consumers'='\VED\Policy\myappobject.company.com'} +Set-TppAttribute -Path '\VED\Policy\My Folder\app.company.com' -Attribute @{'My custom field Label'='new custom value'} -BypassValidation +``` + +Set value on custom field bypassing field validation + +### EXAMPLE 4 +``` +Set-TppAttribute -Path '\VED\Policy\My Folder' -Policy -ClassName 'X509 Certificate' -Attribute @{'Notification Disabled'='0'} +``` + +Set a policy attribute + +### EXAMPLE 5 +``` +Set-TppAttribute -Path '\VED\Policy\My Folder' -Policy -ClassName 'X509 Certificate' -Attribute @{'Notification Disabled'='0'} -Lock ``` -Set value on a certificate by overwriting any existing values +Set a policy attribute and lock the value ## PARAMETERS @@ -43,12 +65,12 @@ Set value on a certificate by overwriting any existing values Path to the object to modify ```yaml -Type: String[] +Type: String Parameter Sets: (All) Aliases: DN Required: True -Position: 1 +Position: Named Default value: None Accept pipeline input: True (ByPropertyName, ByValue) Accept wildcard characters: False @@ -64,7 +86,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 2 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -76,7 +98,55 @@ Only appicable to custom fields. ```yaml Type: SwitchParameter -Parameter Sets: (All) +Parameter Sets: Object +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Policy +Set policies (aka policy attributes) instead of object attributes + +```yaml +Type: SwitchParameter +Parameter Sets: Policy +Aliases: + +Required: True +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ClassName +Required when setting policy attributes. +Provide the class name to set the value for. +If unsure of the class name, add the value through the TPP UI and go to Support-\>Policy Attributes to find it. + +```yaml +Type: String +Parameter Sets: Policy +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Lock +Lock the value on the policy. +Only applicable to setting policies. + +```yaml +Type: SwitchParameter +Parameter Sets: Policy Aliases: Required: False @@ -96,7 +166,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 3 +Position: Named Default value: $script:VenafiSession Accept pipeline input: False Accept wildcard characters: False @@ -150,7 +220,9 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable [https://github.com/gdbarron/VenafiPS/blob/main/VenafiPS/Public/Set-TppAttribute.ps1](https://github.com/gdbarron/VenafiPS/blob/main/VenafiPS/Public/Set-TppAttribute.ps1) -[https://docs.venafi.com/Docs/21.2/TopNav/Content/SDK/WebSDK/r-SDK-POST-Metadata-Set.php?tocpath=Platform%20SDK%7CWeb%20SDK%20REST%7CCertificate%20end%20points%20for%20TLS%7CMetadata%20custom%20fields%20API%7C_____17](https://docs.venafi.com/Docs/21.2/TopNav/Content/SDK/WebSDK/r-SDK-POST-Metadata-Set.php?tocpath=Platform%20SDK%7CWeb%20SDK%20REST%7CCertificate%20end%20points%20for%20TLS%7CMetadata%20custom%20fields%20API%7C_____17) +[https://docs.venafi.com/Docs/current/TopNav/Content/SDK/WebSDK/r-SDK-POST-Metadata-Set.php](https://docs.venafi.com/Docs/current/TopNav/Content/SDK/WebSDK/r-SDK-POST-Metadata-Set.php) + +[https://docs.venafi.com/Docs/current/TopNav/Content/SDK/WebSDK/r-SDK-POST-Config-write.php](https://docs.venafi.com/Docs/current/TopNav/Content/SDK/WebSDK/r-SDK-POST-Config-write.php) -[https://docs.venafi.com/Docs/21.2/TopNav/Content/SDK/WebSDK/r-SDK-POST-Config-write.php?tocpath=Platform%20SDK%7CWeb%20SDK%20REST%7CConfiguration%20end%20points%7CConfig%20API%7C_____36](https://docs.venafi.com/Docs/21.2/TopNav/Content/SDK/WebSDK/r-SDK-POST-Config-write.php?tocpath=Platform%20SDK%7CWeb%20SDK%20REST%7CConfiguration%20end%20points%7CConfig%20API%7C_____36) +[https://docs.venafi.com/Docs/current/TopNav/Content/SDK/WebSDK/r-SDK-POST-Config-writepolicy.php](https://docs.venafi.com/Docs/current/TopNav/Content/SDK/WebSDK/r-SDK-POST-Config-writepolicy.php) diff --git a/mkdocs.yml b/mkdocs.yml index 13151e43..0e59591a 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -37,6 +37,7 @@ pages: - Import-TppCertificate: functions/Import-TppCertificate.md - Invoke-TppCertificatePush: functions/Invoke-TppCertificatePush.md - Invoke-TppCertificateRenewal: functions/Invoke-TppCertificateRenewal.md + - Invoke-VenafiCertificateAction: functions/Invoke-VenafiCertificateAction.md - Invoke-VenafiRestMethod: functions/Invoke-VenafiRestMethod.md - Move-TppObject: functions/Move-TppObject.md - New-TppCapiApplication: functions/New-TppCapiApplication.md