Puppet
Keeper Secrets Manager module for accessing secrets in Puppet catalog execution.

About
Puppet is a powerful infrastructure automation platform that enables consistent and scalable configuration management across your entire IT environment. A solution that supports successful infrastructure as code (IaC), automated provisioning, and continuous compliance within your DevOps process.
The module facilitates secure integration between Puppet and Keeper Secret Manager, enabling the retrieval of secrets during catalog execution.
Features
Use secrets from the Keeper vault in Puppet at catalog execution.
Supports Base64, JSON and Token authentication configuration.
Supports secret output to JSON response, files and environment variables
Prerequisites
Keeper Secrets Manager access (See the Quick Start Guide for more details)
Secrets Manager add-on enabled for your Keeper subscription
Membership in a Role with the Secrets Manager enforcement policy enabled
A Keeper Secrets Manager Application with secrets shared to it
See the Quick Start Guide for instructions on creating an Application
An initialized Keeper Secrets Manager Configuration
Puppet module accepts Base64, Token, JSON format configurations
System Requirements
Puppet: 7.24 or later (for
preprocess_deferredsupport)Python: 3.6 or later on agent nodes
Supported Operating Systems: Linux, macOS, Windows
Critical Configuration
Required: Add this setting to your agent's
puppet.conf:This ensures deferred functions execute during catalog enforcement, not before.
Secrets Notation Format
Notation Format
The notation follows the pattern: "KEEPER_NOTATION > OUTPUT_SPECIFICATION"
Left side: Uses Keeper notation format
Right side: Output specification
VARIABLE_NAME(eg:Label2)env:VARIABLE_NAME(eg:env:Label2)file:/path/to/file-on-agent(eg:file:/opt/ssl/cert.pem)
field or custom_field
Notation query result is placed into JSON output
Notation query result is exported as environment variable on agent
Not allowed
file
file is downloaded and placed into agent's destination
file is downloaded and placed into agent's destination
file is downloaded and placed into agent's destination
Examples:
1. Default (empty)
2. Environment Variable Output ( env: )
3. File Output (file:)
Setup
Step 1: Install the Module
Step 2: Configure Hiera
Create or update your Hiera configuration file (eg : data/common.yaml):
Configuration Structure
Basic Configuration (Required)
Adding Secrets (Optional)
Configuration Details:
keeper::config(Required): Main configuration containerauthentication(Required): Array with exactly 2 elements:[0]: Authentication type (base64,token, orjson)[1]: Authentication value (your credentials orENV:VARIABLE_NAME)
secrets(Optional): Array of Secrets notation strings
Step 3: Set Up Environment Variable (Optional)
If you're using ENV:KEEPER_CONFIG for AUTH_VALUE, then set the environment variable on your Puppet master:
Usage
Include the Module
Using the Custom Lookup Function with Deferred
The module provides a custom function keeper_secrets_manager_puppet::lookup that must be used with Puppet's Deferred() wrapper for runtime execution. Learn more about Deferred Functions
The Deferred('keeper_secrets_manager_puppet::lookup', []) function accepts three parameter options:
No Parameters
Uses secrets from Hiera configuration
Deferred('keeper_secrets_manager_puppet::lookup', [])
Array[String]
Uses secrets from parameters
Deferred('keeper_secrets_manager_puppet::lookup', [$secrets_array])
String
Uses secrets from parameters
Deferred('keeper_secrets_manager_puppet::lookup', ['UID/field/login > login_name'])
Detailed Examples
Option 1: Default Lookup - No Parameters
Option 2: Array of Strings
Option 3: Single String
Complete Example
Troubleshooting
Debug Mode
Enable debug logging by setting the log level in your Puppet configuration:
Common Issues
"preprocess_deferred = false" Error
Problem: Module fails with configuration error
Solution: Add
preprocess_deferred = falseto the[agent]section of yourpuppet.conf
"KSM script not found" Error
Problem: Deferred function fails on first run
Solution: Ensure the module is properly included and Python installation completes
Authentication Failures
Problem: "Authentication failed" errors or
Error: access_denied, message=Unable to validate Keeper application accessSolution: Verify Keeper authentication credentials in configuration and network connectivity
Last updated
Was this helpful?

