Skip to content

AndrewCopeland/conjur-api-powershell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 

Repository files navigation

conjur-api-powershell

Powershell-based API SDK for Conjur OSS.


Status: Alpha

Warning: Naming and APIs are still subject to breaking changes!


Installing the code

From source

PS C:\> Import-Module .\CyberarkConjur.psm1

Usage

Setting environment variables

$env:CONJUR_ACCOUNT="dev"
$env:CONJUR_AUTHN_LOGIN="admin"
$env:CONJUR_AUTHN_API_KEY="adminPassword"
$env:CONJUR_APPLIANCE_URL="https://conjur.yourorg.com:443"

Get-ConjurSecret

Get-ConjurSecret -SecretIdentifier "secrets/db-password"
secretPasswordHere

Set-ConjurSecret

Set-ConjurSecret -SecretIdentifier "secrets/db-password" -SecretValue "brandNewSecret"

Get-ConjurHealth

Get-ConjurHealth

services                                database                                                                     ok
--------                                --------                                                                     --
@{possum=ok; ui=ok; ok=True}            @{ok=True; connect=; free_space=; re...                                    True

Update-ConjurPolicy

Update-ConjurPolicy -PolicyIdentifier "root" -PolicyFilePath ".\test-policy.yml"

created_roles                                                                                                   version
-------------                                                                                                   -------
@{dev:host:database/another-host=}                                                                                    4

Get-ConjurResources

Get-ConjurResources

created_at      : 2019-05-29T16:42:56.284+00:00
id              : dev:policy:root
owner           : dev:user:admin
permissions     : {}
annotations     : {}
policy_versions : {@{version=1; created_at=2019-05-29T16:42:56.284+00:00; policy_text=---       

New-ConjurApiKey

New-ConjurApiKey -RoleKind host -RoleId testing/app1

kdkjhd83hh399fhjjd93939hfjfkdkdshjfhe834hnf83

Get-Help

You can Get-Help on all of the functions mentioned above.

Get-Help Update-ConjurPolicy

NAME
    Update-ConjurPolicy

SYNOPSIS
    Update a policy in conjur


SYNTAX
    Update-ConjurPolicy [-PolicyIdentifier] <String> [-PolicyFilePath] <String> [-ConjurAccount <Object>]
    [-ConjurUsername <Object>] [-ConjurPassword <Object>] [-ConjurApplianceUrl <Object>] [-IgnoreSsl]
    [<CommonParameters>]


DESCRIPTION
    Modifies an existing Conjur policy. Data may be explicitly deleted using the !delete, !revoke, and !deny
    statements.
    Unlike replace mode, no data is ever implicitly deleted.


RELATED LINKS
    https://www.conjur.org/api.html#policies-update-a-policy-patch

REMARKS
    To see the examples, type: "get-help Update-ConjurPolicy -examples".
    For more information, type: "get-help Update-ConjurPolicy -detailed".
    For technical information, type: "get-help Update-ConjurPolicy -full".
    For online help, type: "get-help Update-ConjurPolicy -online"

Contributing

We store instructions for development and guidelines for how to build and test this project in the CONTRIBUTING.md - please refer to that document if you would like to contribute.

License

This project is licensed under Apache License v2.0

About

Conjur client API library for Powershell https://www.conjur.org

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published