Skip to content

How to Integrate Chef with Securden Password Vault for Enterprises

Securden Password Vault for Enterprises integrates with Chef through the Securden Ruby gem.

Chef recipes can use the integration to retrieve account credentials and attributes from Securden and perform supported account operations without storing passwords directly in Chef code.

Prerequisites

Before configuring the Chef integration, obtain:

  • Securden Server URL / Host URL
  • Authentication Token
  • SSL Certificate Path, if required

Obtain the Securden Server URL

Navigate to:

Admin >> General >> Securden Server Connectivity

Copy the appropriate server URL for the Chef environment.

Admin page in Securden Password Vault for Enterprises showing the Securden Server Connectivity option under General

Securden Server Connectivity page showing fields for the server access URL and web-based RDP and SSH gateway URLs

Generate an API Token

Navigate to:

Admin >> API Access >> Create and Manage API Tokens

While creating the token:

  1. Enter an API reference name and description.
  2. Specify the IP address or IP range from which the token can be used.
  3. Select a static or dynamic authentication token as required.
  4. Define the token scope by selecting the operations the Chef integration needs to perform.
  5. Click Create Token.
  6. Copy the generated authentication token and store it securely.

Admin page in Securden Password Vault for Enterprises showing the Create and Manage API Tokens option under API Access

Edit API Configuration page in Securden showing API reference name, allowed IPs or FQDNs, token validity, rate limiting, and token applicability settings

Copy the token now dialog in Securden displaying the generated API authentication token with a copy option

Install the Securden Gem

Install the Securden gem in the Chef environment:

chef gem install securden

Refer to the Securden package on RubyGems for package information and updates.

[Screenshot Placeholder: Chef 3]

Use the Securden Gem in Chef Recipes

At the beginning of the Chef recipe, load the Securden dependency:

require 'securden'

Note: Use single quotation marks for string inputs in Chef recipes as required by the Securden integration.

Initialize the Securden Connection

Initialize the integration with the required Securden connection parameters:

require 'securden'

Securden::Init.new(
  server_url: '<SECURDEN_SERVER_URL>',
  authtoken: '<SECURDEN_AUTHTOKEN>',
  # Optional
  certificate: '/path/to/certificate.pem',
)

The certificate is optional.

If a certificate is explicitly supplied, the connection uses that certificate for verification. An incorrect certificate causes the connection to fail.

When a certificate is not provided, the integration attempts to retrieve the Securden server certificate automatically. If automatic certificate retrieval is unsuccessful, certificate verification can be disabled by the integration while HTTPS continues to protect data in transit.

Fetch a Single Account

Use Securden::Account.get to retrieve one account.

Fetch by Account ID

account_data = Securden::Account.get(
  account_id: 2000000001800,
)

Fetch by Account Title and Account Name

account_data = Securden::Account.get(
  account_title: 'Account Title',
  account_name: 'Account Name',
  account_type: 'Web Account',
)

An account can be identified by its Account ID, Account Title, Account Name, or a combination of Account Title and Account Name.

After retrieving the account, access the required values from the returned account data.

Provide a Reason or Ticket ID When Required

Additional controls configured for an account can also apply to programmatic retrieval.

If justification is enforced, include:

  • reason

If ticketing-system validation is enforced, include:

  • ticket_id

Provide these values whenever the corresponding Securden controls require them.

Fetch Multiple Accounts

Use Securden::Accounts.get when the Chef recipe needs to retrieve several accounts.

accounts = Securden::Accounts.get(
  account_ids: [2000000001800, 2000000002000]
)

Access the returned account using its Account ID as a string:

accounts['2000000005222']['password']

Use:

  • Securden::Account.get for a single account.
  • Securden::Accounts.get for multiple accounts.

Add an Account

Use Securden::Account.add to create an account:

account = Securden::Account.add(
  account_title: 'Account Title',
  account_name: 'Account Name',
  account_type: 'Web Account',
)

The following fields are mandatory:

  • account_title
  • account_name
  • account_type

Other supported fields include:

  • ipaddress
  • notes
  • tags
  • personal_account
  • folder_id
  • password
  • account_expiration_date – DD/MM/YYYY
  • distinguished_name – Required for applicable LDAP domain accounts.
  • account_alias – Required for applicable AWS IAM accounts.
  • domain_name – Required for applicable Google Workspace accounts.

Update an Existing Account

Use Securden::Account.edit and provide the Account ID together with the values that need to be changed.

Securden::Account.edit(
  account_id: 2000000004745,
  account_title: 'New Title',
  account_name: 'New Name',
  account_type: 'Web Account'
)

Supported fields include:

  • account_id – Required.
  • account_title
  • account_name
  • account_type
  • ipaddress
  • notes
  • tags
  • folder_id
  • overwrite_additional_fields
  • account_expiration_date
  • distinguished_name
  • account_alias
  • domain_name

Provide only the fields applicable to the account being updated.

Delete Accounts

Use Securden::Accounts.delete to delete one or more accounts:

Securden::Accounts.delete(
  account_ids: [2000000004745, 2000000004739],
  reason: 'Reason for Account Deletion',
)

The operation returns the Account IDs that were successfully deleted.

By default, deleted accounts are moved to Recently Deleted Accounts.

To delete the accounts permanently:

Securden::Accounts.delete(
  account_ids: [2000000004745, 2000000004739],
  reason: 'Reason for Account Deletion',
  delete_permanently: true
)

Use permanent deletion only when the accounts should not be retained in Recently Deleted Accounts.

Account Attributes Available Through Chef

Depending on the account type and configuration, the following values can be retrieved:

  • account_id
  • account_name
  • account_title
  • password
  • private_key
  • putty_private_key
  • passphrase
  • ppk_passphrase
  • address
  • client_id
  • client_secret
  • account_alias
  • account_file
  • default_database
  • oracle_sid
  • oracle_service_name
  • port

Additional Fields

Custom fields configured for an account can also be accessed. The available values depend on the additional fields defined for the corresponding account or account type.

Frequently Asked Questions

1. How is Chef integrated with Securden Password Vault?

Chef uses the Securden Ruby gem. Install it with chef gem install securden, load it with require 'securden', and initialize the connection using the Securden server URL and authentication token.

2. Which method retrieves a single Securden account from Chef?

Use Securden::Account.get to retrieve one account.

3. How can Chef retrieve multiple accounts from Securden?

Use Securden::Accounts.get and supply the required Account IDs.

4. Can Chef create, edit, and delete Password Vault accounts?

Yes. The Securden Chef integration provides methods for adding, editing, and deleting accounts, subject to the permissions and scope of the authentication token.

5. What happens to accounts deleted through the Chef integration?

By default, deleted accounts are moved to Recently Deleted Accounts. Specify delete_permanently: true when permanent deletion is explicitly required.