From 93c6bccee008d8997184a021a578a4292f5001fb Mon Sep 17 00:00:00 2001 From: Greg Brownstein Date: Fri, 29 Apr 2022 20:13:05 +0000 Subject: [PATCH] Update manifest and docs to 4.2.4 --- CHANGELOG.md | 7 ++ VenafiPS/VenafiPS.psd1 | 7 +- docs/changelog.md | 7 ++ docs/functions/Move-TppObject.md | 16 +++-- docs/functions/New-VenafiSession.md | 22 +++--- docs/functions/Search-TppHistory.md | 101 ++++++++++++++++++++++++++++ mkdocs.yml | 1 + 7 files changed, 146 insertions(+), 15 deletions(-) create mode 100644 docs/functions/Search-TppHistory.md diff --git a/CHANGELOG.md b/CHANGELOG.md index d2b6c295..19a8be1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 4.2.4 +- Add `Search-TppHistory` to find historical items by attribute value and their associated current item +- Fix `Move-TppObject` not appending object name when moving multiple objects to a new folder and passed via pipeline +- Update `Find-TppObject` to allow passing of empty string for `-Pattern` to find objects which don't have a value set + + ## 4.2.3 - Fix certain aliases not being exported @@ -352,3 +358,4 @@ + diff --git a/VenafiPS/VenafiPS.psd1 b/VenafiPS/VenafiPS.psd1 index 9ba89ed8..752d0573 100644 --- a/VenafiPS/VenafiPS.psd1 +++ b/VenafiPS/VenafiPS.psd1 @@ -3,7 +3,7 @@ # # Generated by: Venafi # -# Generated on: 04/22/2022 +# Generated on: 04/29/2022 # @{ @@ -12,7 +12,7 @@ RootModule = 'VenafiPS.psm1' # Version number of this module. -ModuleVersion = '4.2.3' +ModuleVersion = '4.2.4' # Supported PSEditions # CompatiblePSEditions = @() @@ -100,7 +100,8 @@ FunctionsToExport = 'Add-TppCertificateAssociation', 'Convert-TppObject', 'Set-TppWorkflowTicketStatus', 'Test-ModuleHash', 'Test-TppIdentity', 'Test-TppObject', 'Test-TppToken', 'Write-TppLog', 'Get-VenafiTeam', 'Remove-VenafiTeam', 'Add-VenafiTeamMember', 'Add-VenafiTeamOwner', - 'Remove-VenafiTeamMember', 'Remove-VenafiTeamOwner', 'New-VenafiTeam', 'Search-TppHistory' + 'Remove-VenafiTeamMember', 'Remove-VenafiTeamOwner', 'New-VenafiTeam', + 'Search-TppHistory' # 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 8b12edf6..83538c5d 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,3 +1,9 @@ +## 4.2.4 +- Add `Search-TppHistory` to find historical items by attribute value and their associated current item +- Fix `Move-TppObject` not appending object name when moving multiple objects to a new folder and passed via pipeline +- Update `Find-TppObject` to allow passing of empty string for `-Pattern` to find objects which don't have a value set + + ## 4.2.3 - Fix certain aliases not being exported @@ -352,3 +358,4 @@ + diff --git a/docs/functions/Move-TppObject.md b/docs/functions/Move-TppObject.md index 8e9f3946..43487e95 100644 --- a/docs/functions/Move-TppObject.md +++ b/docs/functions/Move-TppObject.md @@ -11,20 +11,27 @@ Move-TppObject [-SourcePath] [-TargetPath] [[-VenafiSession] < ``` ## DESCRIPTION -Move an object of any type +Move an object of any type from one policy to another. +A rename can be done at the same time as the move by providing a full target path including the new object name. ## EXAMPLES ### EXAMPLE 1 ``` Move-TppObject -SourceDN '\VED\Policy\My Folder\mycert.company.com' -TargetDN '\VED\Policy\New Folder\mycert.company.com' -Moves mycert.company.com to a new Policy folder +Move object to a new Policy folder +``` + +### EXAMPLE 2 +``` +Find-VenafiCertificate -Path '\ved\policy\certs' | Move-TppObject -TargetDN '\VED\Policy\New Folder' +Move all objects found in 1 folder to another ``` ## PARAMETERS ### -SourcePath -Full path to an object in TPP +Full path to an existing object in TPP ```yaml Type: String @@ -39,7 +46,8 @@ Accept wildcard characters: False ``` ### -TargetPath -New path +New path. +This can either be an existing policy and the existing object name will be kept or a full path including a new object name. ```yaml Type: String diff --git a/docs/functions/New-VenafiSession.md b/docs/functions/New-VenafiSession.md index 51eeb536..14c5b846 100644 --- a/docs/functions/New-VenafiSession.md +++ b/docs/functions/New-VenafiSession.md @@ -98,53 +98,59 @@ Create token-based session using Windows Integrated authentication with a certai ### EXAMPLE 4 ``` +New-VenafiSession -Server venafitpp.mycompany.com -Credential $cred -ClientId MyApp -Scope @{'certificate'='manage'} +Create token-based session +``` + +### EXAMPLE 5 +``` New-VenafiSession -Server venafitpp.mycompany.com -Certificate $myCert -ClientId MyApp -Scope @{'certificate'='manage'} Create token-based session using a client certificate ``` -### EXAMPLE 5 +### EXAMPLE 6 ``` New-VenafiSession -Server venafitpp.mycompany.com -AuthServer tppauth.mycompany.com -ClientId MyApp -Credential $cred Create token-based session using oauth authentication where the vedauth and vedsdk are hosted on different servers ``` -### EXAMPLE 6 +### EXAMPLE 7 ``` $sess = New-VenafiSession -Server venafitpp.mycompany.com -Credential $cred -PassThru Create session and return the session object instead of setting to script scope variable ``` -### EXAMPLE 7 +### EXAMPLE 8 ``` New-VenafiSession -Server venafitpp.mycompany.com -AccessToken $accessCred Create session using an access token obtained outside this module ``` -### EXAMPLE 8 +### EXAMPLE 9 ``` New-VenafiSession -Server venafitpp.mycompany.com -RefreshToken $refreshCred -ClientId MyApp Create session using a refresh token ``` -### EXAMPLE 9 +### EXAMPLE 10 ``` New-VenafiSession -Server venafitpp.mycompany.com -RefreshToken $refreshCred -ClientId MyApp -VaultRefreshTokenName TppRefresh Create session using a refresh token and store the newly created refresh token in the vault ``` -### EXAMPLE 10 +### EXAMPLE 11 ``` New-VenafiSession -Server venafitpp.mycompany.com -RefreshToken $refreshCred -ClientId MyApp -VaultRefreshTokenName TppRefresh -VaultMetadata Create session using a refresh token, store the newly created refresh token in the vault, and store the server and clientid with the secret ``` -### EXAMPLE 11 +### EXAMPLE 12 ``` New-VenafiSession -VaasKey $cred Create session against Venafi as a Service ``` -### EXAMPLE 12 +### EXAMPLE 13 ``` New-VenafiSession -VaultVaasKeyName vaas-key Create session against Venafi as a Service with a key stored in a vault diff --git a/docs/functions/Search-TppHistory.md b/docs/functions/Search-TppHistory.md new file mode 100644 index 00000000..4a35213a --- /dev/null +++ b/docs/functions/Search-TppHistory.md @@ -0,0 +1,101 @@ +# Search-TppHistory + +## SYNOPSIS +Search TPP history for items with specific attributes + +## SYNTAX + +``` +Search-TppHistory [[-Path] ] [-Attribute] [[-VenafiSession] ] + [] +``` + +## DESCRIPTION +Items in the secret store matching the key/value provided will be found and their details returned with their associated 'current' item. +As this function may return details on many items, optional parallel processing has been implemented. +Be sure to use PowerShell Core, v7 or greater, to take advantage. + +## EXAMPLES + +### EXAMPLE 1 +``` +Search-TppHistory -Attribute @{'ValidTo' = (Get-Date)} +Find historical items that are still active +``` + +### EXAMPLE 2 +``` +Search-TppHistory -Attribute @{'ValidTo' = (Get-Date)} -Path '\ved\policy\certs' +Find historical items that are still active and the current item starts with a specific path +``` + +## PARAMETERS + +### -Path +Starting path to associated current items to limit the search. +The default is \VED\Policy. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: \VED\Policy +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Attribute +Name and value to search. +See https://docs.venafi.com/Docs/current/TopNav/Content/SDK/WebSDK/r-SDK-POST-Secretstore-lookupbyassociation.php for more details. +Note, ValidFrom will perform a greater than or equal comparison and ValidTo will perform a less than or equal comparison. +Currently, one 1 name/value pair can be used. + +```yaml +Type: Hashtable +Parameter Sets: (All) +Aliases: + +Required: True +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -VenafiSession +Authentication for the function. +The value defaults to the script session object $VenafiSession created by New-VenafiSession. +A TPP token or VaaS key can also provided. +If providing a TPP token, an environment variable named TppServer must also be set. + +```yaml +Type: PSObject +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: $script:VenafiSession +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 + +### None +## OUTPUTS + +### PSCustomObject with the following properties: +### Name +### TypeName +### Path +### History +## NOTES + +## RELATED LINKS diff --git a/mkdocs.yml b/mkdocs.yml index 27d3ad4a..095b72ee 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -89,6 +89,7 @@ nav: - Rename-TppObject: functions/Rename-TppObject.md - Revoke-TppCertificate: functions/Revoke-TppCertificate.md - Revoke-TppToken: functions/Revoke-TppToken.md + - Search-TppHistory: functions/Search-TppHistory.md - Set-TppAttribute: functions/Set-TppAttribute.md - Set-TppCodeSignProjectStatus: functions/Set-TppCodeSignProjectStatus.md - Set-TppCredential: functions/Set-TppCredential.md