API to delete expired certificates on venafi

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements

Welcome Idira to LIVEcommunity!

Our community just got stronger! Explore new identity security resources, connect with experts, and discover more ways to learn and collaborate.

Meet Idira

API to delete expired certificates on venafi

L0 Member
Hi,I would like to delete the certificates which are expired prior 1/2 years. And want this to happen through APIAny inputs or suggestions on this?.
2 REPLIES 2

L1 Bithead

Not sure which version you are using, but any supported version of Certificate Manager, Self Hosted has the Recycle Bin feature which can be configured to do exactly what you're looking for: https://docs.venafi.com/Docs/24.1/TopNav/Content/Configuration/PlatformConfig/c-vcc-about-recycle-bin.php

 

Other than that you'll have to use the API to search for certs which expire in that window and iterate through them deleting them one at a time.

L3 Networker

As Dan said, you need to search for expired certs and then delete them. To find (expired) certs, the api is https://docs.venafi.com/Docs/currentAPI/#?route=get-/vedsdk/certificates. You will need to provide today's date to ValidToLess and the date from 6 months ago to ValidToGreater. To delete the certificate(s) you can use https://docs.venafi.com/Docs/currentAPI/#?route=delete-/vedsdk/certificates/-guid-.

 

If you are open to using powershell, you can use the VenafiPS powershell module to do this quite easily:

Find-VdcCertificate -ExpireAfter (get-date).AddMonths(-6) -ExpireBefore (get-date) | Remove-VdcCertificate

 

  • 180 Views
  • 2 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!