Skip to content

Commit 5b6131e

Browse files
authored
Merge pull request #9 from github/kpaulisse-pe-doc-update
Update documentation and examples for puppetdb SSL settings
2 parents 68b4977 + cd4c576 commit 5b6131e

2 files changed

Lines changed: 25 additions & 5 deletions

File tree

doc/configuration-puppetdb.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ For this to work, you will need to configure or provide information about your P
1616

1717
- **SSL Authentication Information**: Whether your PuppetDB instance requires clients to authenticate via SSL certificates. Unless you have made a special effort to configure your PuppetDB instance not to require client certificates, it is likely that client certificate authentication is required.
1818

19+
NOTE: In certain situations, you may need to define or alter the `certificate-whitelist` setting in your PuppetDB configuration to whitelist the certificate used by octocatalog-diff. Please see [Configuring PuppetDB](https://docs.puppet.com/puppetdb/latest/configure.html#certificate-whitelist) in the Puppet documentation for additional information.
20+
1921
## Supplying necessary information via configuration files
2022

2123
The following settings can be used in a [configuration file](/doc/configuration.md).
@@ -24,8 +26,9 @@ The following settings can be used in a [configuration file](/doc/configuration.
2426
| --- | --- |
2527
| `settings[:puppetdb_url]` | PuppetDB URL settings. If this is a string, it will set a single PuppetDB URL. If it is an array, it will set multiple URLs, which will be tried in a random order until one responds. |
2628
| `settings[:puppetdb_ssl_ca]` | Path to the certificate of the CA that signed PuppetDB's certificate. This file is typically found in `/etc/puppetlabs/puppetdb/ssl/ca.pem` on your PuppetDB server. This file should contain only the public certificate, so it is safe to distribute to developer workstations or CI environments. |
27-
| `settings[:puppetdb_ssl_client_cert]` | Path to the certificate of the client SSL keypair. You should generate a keypair specifically for this client (or if you are running this on a machine managed by Puppet, you may be able to use the keypair for the client machine). You should **NOT** copy the certificate from your PuppetDB server itself. |
28-
| `settings[:puppetdb_ssl_client_key]` | Path to the private key of the client SSL keypair. You should generate a keypair specifically for this client (or if you are running this on a machine managed by Puppet, you may be able to use the keypair for the client machine). You should **NOT** copy the private key from your PuppetDB server itself. |
29+
| `settings[:puppetdb_ssl_client_cert]` | TEXT of the certificate of the client SSL keypair. You should generate a keypair specifically for this client (or if you are running this on a machine managed by Puppet, you may be able to use the keypair for the client machine). You should **NOT** copy the certificate from your PuppetDB server itself. Note: This variable needs to be set to the TEXT of the certificate, and not the file path. This means you will likely want to use `File.read(...)` if you are configuring this to be read from a file. |
30+
| `settings[:puppetdb_ssl_client_key]` | Path to the private key of the client SSL keypair. You should generate a keypair specifically for this client (or if you are running this on a machine managed by Puppet, you may be able to use the keypair for the client machine). You should **NOT** copy the private key from your PuppetDB server itself. Note: This variable needs to be set to the TEXT of the key, and not the file path. This means you will likely want to use `File.read(...)` if you are configuring this to be read from a file. |
31+
| `settings[:puppetdb_ssl_client_pem]` | Concatenation of the text of `puppetdb_ssl_client_key` and `puppetdb_ssl_client_cert` as previously described. This is a good alternative if your certificate chain is complex and it's easier just to put everything in a single place. Note: this option is second in precedence; if `settings[:puppetdb_ssl_client_cert]` and `settings[:puppetdb_ssl_client_key]` are both set, this will be ignored. |
2932
| `settings[:puppetdb_ssl_client_password]` | Plain text string containing the password to unlock the private key. For keys generated by the Puppet Master CA, this is not required and should be left undefined. |
3033

3134
## Supplying necessary information via the command line

examples/octocatalog-diff.cfg.rb

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,19 +76,36 @@ def self.config
7676
# puppetdb_ssl_client_key
7777
# puppetdb_ssl_client_password
7878
# puppetdb_ssl_client_cert
79+
# puppetdb_ssl_client_pem
80+
#
81+
# This sets up SSL authentication for PuppetDB.
82+
#
7983
# For SSL authentication, the key and certificate used for SSL client authentication.
8084
# Don't set these if your PuppetDB is unauthenticated. The provided example may work if you
8185
# run octocatalog-diff on a machine managed by Puppet, and your PuppetDB authenticates
82-
# clients with that same CA. Otherwise, just provide the actual path to the key and the
86+
# clients with that same CA. Otherwise, fill in the actual path to the key and the
8387
# certificate in the relevant settings. If the key is password protected, set
8488
# :puppetdb_ssl_client_password to the text of the password.
89+
#
90+
# You can configure this in one of two ways:
91+
# 1. Set `puppetdb_ssl_client_key` and `puppetdb_ssl_client_cert` individually.
92+
# 2. Set `puppetdb_ssl_client_pem` to the concatenation of the key and the certificate.
93+
#
94+
# VERY IMPORTANT: settings[:puppetdb_ssl_client_key], settings[:puppetdb_ssl_client_cert], and
95+
# settings[:puppetdb_ssl_client_pem] need to be set to the TEXT OF THE CERTIFICATE/KEY, not
96+
# just the file name of the certificate. You'll probably need to use something like this:
97+
# settings[:puppetdb_ssl_client_WHATEVER] = File.read("...")
98+
#
8599
# More: https://github.com/github/octocatalog-diff/blob/master/doc/configuration-puppetdb.md
86100
##############################################################################################
87101

88102
# require 'socket'
89103
# fqdn = Socket.gethostbyname(Socket.gethostname).first
90-
# settings[:puppetdb_ssl_client_key] = "/etc/puppetlabs/puppet/ssl/private_keys/#{fqdn}.pem"
91-
# settings[:puppetdb_ssl_client_cert] = "/etc/puppetlabs/puppet/ssl/certs/#{fqdn}.pem"
104+
# settings[:puppetdb_ssl_client_key] = File.read("/etc/puppetlabs/puppet/ssl/private_keys/#{fqdn}.pem")
105+
# settings[:puppetdb_ssl_client_cert] = File.read("/etc/puppetlabs/puppet/ssl/certs/#{fqdn}.pem")
106+
107+
# For keys generated by Puppet, passwords are not needed so the next setting can be left commented.
108+
# If you generated your own key outside of Puppet and it has a password, specify it here.
92109
# settings[:puppetdb_ssl_client_password] = 'your-password-here'
93110

94111
##############################################################################################

0 commit comments

Comments
 (0)