thycotic-ps / thycotic.secretserver

PowerShell module for automating with Thycotic Secret Server REST API
https://thycotic-ps.github.io/thycotic.secretserver
MIT License
68 stars 22 forks source link

Find-TssSecret -SharedWithMe option to include secrets where you're an owner #263

Closed TryTryAgain closed 1 year ago

TryTryAgain commented 2 years ago

Summarize Functionality

We've been relying on the easy Find-TssSecret -TssSession $session -SharedWithMe but have recently needed to switch our process of handing over credentials so that we are asking people to set us as Owner ... this way we can clean up and remove the shared secrets after we've replaced it with a managed/secured secret. But we're unable to track those because the limitation within https://thycotic-ps.github.io/thycotic.secretserver/commands/secrets/Find-TssSecret.html#-sharedwithme : "Secrets where you are not the owner and secret is explicitly shared with your user"

Is there a command that is similiar or close to what you are looking for?

No

Technical Details

If there is an alternative way to achieve the same that would be great to know. If not, I feel it would be really helpful to have a -SharedWithMe that can also output secrets that you are an owner of.

TryTryAgain commented 2 years ago

My workaround has been to loop through all secrets of a certain template type and then do a

Get-TssFolder -TssSession $session -Id $folderId -ErrorAction SilentlyContinue > $null
    If ($Error.Exception.Message -Match "API_AccessDenied-Access") {
        Write-Host "Restricted Folder, secret must be 'SharedWithMe'..."
    }

Not ideal ... using the Find-TssSecret -TssSession $session -SharedWithMe took less than a minute to complete, the method described above has to loop through many hundreds of secrets and is taking ~10 minutes to complete.