RamblingCookieMonster / SecretServer

Secret Server PowerShell Module
MIT License
87 stars 28 forks source link
password-manager powershell powershell-modules secret secret-management secret-server secrets

Secret Server PowerShell Module

This is a PowerShell module for working with Thycotic Secret Server's web services. If you use this module, check in every so often, there will be regular updates.

This is a quick and dirty implementation based on my environment's configuration. Contributions to improve this would be more than welcome!

Some caveats:

Functionality

Search for secrets without triggering an audit:

Extract Secure String password and PSCredential credential object from secrets:

Find folders:

Find templates:

Create new secrets:

Change existing secrets:

Find permissions for a secret:

List secret audit activity:

Get Secret Activity directly from the database:

Get connected:

Prerequisites

Instructions

#One time setup:
    #Download the repository
    #Unblock the zip file
    #Extract SecretServer folder to a module path (e.g. $env:USERPROFILE\Documents\WindowsPowerShell\Modules\)

#Each PowerShell session
    Import-Module SecretServer  #Alternatively, Import-Module "\\Path\To\SecretServer"

#List commands in the module
    Get-Command -Module SecretServer

#Get help for a command
    Get-Help New-SSConnection -Full

#Optional one time step: Set default Uri, create default proxy
    Set-SecretServerConfig -Uri https://FQDN.TO.SECRETSERVER/winauthwebservices/sswinauthwebservice.asmx
    New-SSConnection #Uses Uri we just set by default

#Get help for Get-Secret
    Get-Help Get-Secret -Full

#List a summary of all secrets
    Get-Secret

#Convert stored secret to a credential object you can use in a variety of scenarios
    $Credential = (Get-Secret -SearchTerm SVC-WebCommander -as Credential ).Credential
    $Credential

    <#
        UserName : My.Domain\SVC-WebCommander
        Password : System.Security.SecureString
    #>

#List commands that directly hit the SQL database
    Get-Command -Module SecretServer -ParameterName ServerInstance |
        Where {$_.Name -notlike "*SecretServerConfig"}

Changelog

Aside

On an aside, if you don't have a password management solution in place, definitely take a look at Secret Server.

I've been impressed with the product, documentation, and support. It's one of those products that just works, and works well. If you're a non-profit, you'll save a bit...

Project Status, 1/17/2016: I no longer work with or have access to Secret Server. Feel free to fork this or use it as needed, but there will likely be no further development, barring external contributions.