Securden Chef Plugin

The Securden Chef plugin enables seamless integration with Securden Secrets Manager, making it easy to fetch and utilize account details within your Chef recipes. This guide provides a detailed overview of the plugin's features and usage.

Installation

Add the Securden Chef plugin gem to your Chef environment. Ensure all required dependencies, including Ruby and the Chef client, are properly installed and configured.

Initialization

The Securden plugin is initialized with the following parameters:

  • server_url: The URL of your Securden Secrets Manager server.
  • authtoken: The authentication token required for API access.
  • certificate: (Optional) Path to the certificate file. If omitted, the plugin automatically fetches the certificate.

Usage Example

require 'Securden'

securden = nil

ruby_block 'Plugin Initialize Block' do
  block do
    securden = Securden::Account.new(
      server_url: node['securden']['server_url'],
      authtoken: node['securden']['authtoken'],
      certificate: node['securden']['certificate'] # Certificate is optional
    )
  end
end

ruby_block 'Get Account Block' do
  block do
    if securden
       = securden.get(account_id: node['securden']['account_id'])
      if 
        puts "\nPassword: #{['password']}"
      end
    end
  end
end

Access

Once the account data is fetched, you can access its attributes directly, such as password, or any additional fields created in the account.

Example Workflow

  1. Define necessary node attributes, such as server_url, authtoken, and optionally, certificate.
  2. Initialize the Securden plugin using the Securden::Account.new method.
  3. Use the get method to fetch account details.
  4. Access and utilize the required attributes in your Chef recipes.

Key Features

  1. Plugin Initialization:

    • Simplifies the initialization process with essential parameters (server_url, authtoken, certificate).
  2. Fetching Account Data:

    • Retrieve account details using the get method by providing any of the following:
      • account_id
      • account_title
      • account_name
      • Combination of account_name and account_title
  3. Accessing Account Attributes:

    • Access the fetched account's attributes, such as password, or additional fields created in the account.

Additional Notes

  • Ensure that server_url and authtoken values are securely stored and not hardcoded in your recipes.
  • The certificate parameter is optional; the plugin will automatically fetch it if not provided.
  • Additional fields in the account can be accessed using their respective names.

For further details and support, refer to the official Securden documentation.