Terraform Conjur Plugin

A Terraform plugin to retrieve secrets from Cyberark Conjur.

Features

Requirements

Getting Started

Usage

Open (or create) a Terraform project. Add the following lines to configure the provider and retrieve credential data.


provider "conjur" {
    ### required ###
    login = "username"
    api_key = "xxxxxx"
    appliance_url = "https://conjur.corp.example.com"
    account = "myorg"
}


data "conjur_secret" "myresourcename" {
    # you can retrieve secrets by variableid
    id = "eval/secret"
}

# this is just for example purposes
output "credential_data_value" {
  value = "${lookup(data.conjur_secret.myresourcename.data, "text")}"
}

# output "metadata" {
#   value = "${data.conjur_secret.myresourcename.metadata}"
# }

Configuration

Provider

provider "conjur" {
    ### required ###
    login = "username"
    api_key = "xxxxxx"
    appliance_url = "https://conjur.corp.example.com"
    account = "myorg"

    ### optional ###
    # version = "~> 1.0" # see https://www.terraform.io/docs/configuration/providers.html#provider-versions
    # alias = "conjur_prod" # see https://www.terraform.io/docs/configuration/providers.html#multiple-provider-instances
}

The login, api_key, appliance_url and account configuration options can also be specified via environmental variables:

In the interest of security, It is recommended that you specify the api_key via environmental variable (CONJUR_API_KEY).

In additional to the login, api_key, appliance_url and account configuration options, this plugin supports the Terraform built-in version constraints and alias system.

Data Source

data "conjur_secret" "example_com_credentials" {
    # you can retrieve secrets by variableid
    id = "eval/secret"

    ### optional ###
    # if you set a alias for the provider, you must reference it in the data source. See https://www.terraform.io/docs/configuration/providers.html#multiple-provider-instances
    # provider = "conjur.conjur_prod"
}

The Terraform plugin for Cyberark Conjur supports retrieving secrets via policy varible id’s.

Credentials

A Conjur entity (either host or user) has it’s own unique API key which is used along with the id for authentication.

An API key is an alphanumeric string with length of 51 to 56 characters. It is generated randomly during identity creation, and can be rotated at a later time.

This plugin also works with Cyberark Conjur Eval Server accounts, which is free but is public and should only be used for evaluation purposes.

Versioning

We use SemVer for versioning.

Updates

Once new versions are available, you’ll be notified via email.

Author

License

All Rights Reserved