No commit activity in last 3 years
No release in over 3 years
Hiera backend for looking up OS X keychain
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
~> 1.0
~> 10.0
~> 3.0.0
 Project Readme

Hiera OS X Keychain Backend

A simple Hiera backend for looking up OS X keychain.

Requirements

This Hiera backend requires OS X, obviously.

Usage

Install hiera-osxkeychain gem to the Hiera environment.

gem intall hiera-osxkeychain

In hiera.yaml config file, add osxkeychain backend and specify service name used in keychain. By default, service name is hiera.

:backends:
  - osxkeychain
  ...
:yaml":
  ...
:osxkeychain:
  :service: "hiera"
:hierarchy:
  ...

Create generic password items in OS X keychain with specified service name. Use account name for each Hiera lookup key.

For example, launch Keychain Access.app, then use New Password Item... under File menu. Give hiera (or service name you specified in hiera.yaml) to Keychain Item Name:, Hiera lookup key name to Account Name:, then set Password:.

Try looking up the key from command line.

hiera -c /path/to/hiera.yaml key

You may see a prompt to approve keychain access from security command.

Limitation

Since keychain is a simple flat secure key-value storage, currently it doesn't support hierarchy. Also doesn't support interporations on the value, which I believe shouldn't be used in the situation of keychain usage.