Venafi / VenafiPS

Powershell module to fully automate your Venafi TLS Protect Datacenter and Cloud platforms!
https://venafips.readthedocs.io/
Apache License 2.0
18 stars 7 forks source link

Add 'Expiration' to Set-VdcCredential and Get-VdcCredential #272

Closed wilddev65 closed 5 months ago

wilddev65 commented 5 months ago

Summary of the new feature/enhancement

When a credential is added via the GUI a date is added automatically added to the Expires field 10 years in the future. This is marked as a required field in the GUI using *. Neither Get-VdcCredential nor Set-VdcCredential currently reads this field. New-VdcCredential is needed to add a brand new credential to the system.

Currently when using the API, New-VdcObject can create any of the different credential types as an object by specifying the class. It, however, does not write the actual credential itself without many extra calls. Using Set-Credential to add the credential itself works for the 3 types supported (currently Username, Password and Certificate) but does not add the Expiration field to a new object that is needed to add the Expiries date. This results in a date of '01/01/0001 07:00:00' being set. Additionally, it does not support certificate credentials that are linked to an existing certificate using the 'Certificate DN' value. Get-VdcCredential does not retrieve this value and it has to be read by using Get-VdcAttribute.

Proposed technical implementation details

I propose refactoring these functions to support all of the credential types, the Expiration value (using a Datetime object type), the Certificate DN value and any other values needed. The addition of New-VdcCredential (using POST Credentials/Create) as a function will make it easier to add any of the different credential types.

gdbarron commented 5 months ago

I'm going to break this up into different issues, lots being asked.