Skip to content

Commit e9c75ea

Browse files
authored
Merge pull request OpenVoxProject#222 from miharp/fix/replace-puppet-cert-with-puppet-ssl
Replace deprecated puppet cert with puppetserver ca and puppet ssl
2 parents 93dcc2d + 75b3db2 commit e9c75ea

14 files changed

Lines changed: 162 additions & 77 deletions

docs/_openvox_8x/config_file_oid_map.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ title: "Config files: custom_trusted_oid_mapping.yaml"
55

66
[extensions]: ./ssl_attributes_extensions.html
77
[mapping_setting]: ./configuration.html#trustedoidmappingfile
8-
[pup-4617]: https://tickets.puppetlabs.com/browse/PUP-4617
98
[csr_attributes]: ./config_file_csr_attributes.html
109
[trusted]: ./lang_facts_and_builtin_vars.html#trusted-facts
1110
[registered]: ./ssl_attributes_extensions.html#puppet-specific-registered-ids
@@ -33,7 +32,6 @@ For more info, see:
3332
Mapping OIDs in this file _only_ affects the keys in the `$trusted[extensions]` hash. It does not affect:
3433

3534
* What an agent can request in its `csr_attributes.yaml` file --- anything but Puppet-specific registered extensions must still be numerical OIDs.
36-
* What you see when you run `puppet cert print` --- mapped extensions will still be displayed as numerical OIDs. (Improving cert display is planned as [PUP-4617][].)
3735

3836
## Location
3937

docs/_openvox_8x/config_important_settings.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ These settings should usually go in `[master]`. However, if you're using Puppet
148148

149149
* [`dns_alt_names`][dns_alt_names] --- A list of hostnames the server is allowed to use when acting as a Puppet master. The hostname your agents use in their `server` setting **must** be included in either this setting or the master's `certname` setting. Note that this setting is only used when initially generating the Puppet master's certificate --- if you need to change the DNS names, you must:
150150
1. Turn off the Puppet server service (or your Rack server).
151-
2. Run `sudo puppet cert clean <MASTER'S CERTNAME>`.
152-
3. Run `sudo puppet cert generate <MASTER'S CERTNAME> --dns_alt_names <ALT NAME 1>,<ALT NAME 2>,...`.
151+
2. Run `sudo puppetserver ca clean --certname <SERVER'S CERTNAME>`.
152+
3. Run `sudo puppetserver ca generate --certname <SERVER'S CERTNAME> --subject-alt-names <ALT NAME 1>,<ALT NAME 2>,...`.
153153
4. Re-start the Puppet server service.
154154
* [`environment_timeout`][environment_timeout] --- For better performance, you can set this to `unlimited` and make refreshing the Puppet master a part of your standard code deployment process. See [the timeout section of the Configuring Environments page][configuring_timeout] for more details.
155155
* [`environmentpath`][environmentpath] --- Controls where Puppet finds directory environments. See [the page on directory environments][environments] for details.

docs/_openvox_8x/config_print.markdown

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ This will show `name = value` pairs for all settings.
5151
The `--section` option specifies which [section of puppet.conf][config_sections] to use when finding settings. It is optional, and defaults to `main`. Valid sections are:
5252

5353
* `main` **(default)** --- used by all commands and services
54-
* `master` --- used by the Puppet master service and the `puppet cert` command
54+
* `master` --- used by the Puppet master service
5555
* `agent` --- used by the Puppet agent service
5656
* `user` --- used by the Puppet apply command and most other commands
5757

@@ -66,10 +66,10 @@ Note that you can only specify environments that already exist.
6666
This option is generally only useful when looking up settings used by the Puppet master service, since it's rare to use environment config sections for Puppet apply and Puppet agent.
6767

6868

69-
Imitating Puppet Master and Puppet Cert
69+
Imitating Puppet Master
7070
-----
7171

72-
To see the settings the Puppet master service and the Puppet cert command would use:
72+
To see the settings the Puppet master service would use:
7373

7474
* Specify `--section master`.
7575
* Use the `--environment` option to specify the environment you want settings for, or let it default to `production`.

docs/_openvox_8x/config_set.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ This will declaratively set the value of `<SETTING NAME>` to `<VALUE>` (in the s
3434
The `--section` option specifies which [section of puppet.conf][config_sections] to modify. It is optional, and defaults to `main`. Valid sections are:
3535

3636
* `main` **(default)** --- used by all commands and services
37-
* `master` --- used by the Puppet master service and the `puppet cert` command
37+
* `master` --- used by the Puppet master service
3838
* `agent` --- used by the Puppet agent service
3939
* `user` --- used by the Puppet apply command and most other commands
4040

docs/_openvox_8x/dirs_confdir.markdown

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,23 @@ Puppet's confdir can be found at one of the following locations:
1818

1919
When Puppet is running as either root, a Windows user with administrator privileges, or the `puppet` user, it will use a system-wide confdir. When running as a non-root user, it will use a confdir in that user's home directory.
2020

21-
The system confdir is what you usually want to use, since you will usually run Puppet's commands and services as root or `puppet`. (Note that admin commands like `puppet cert` must be run with `sudo` to use the same confdir as Puppet agent or Puppet master.)
21+
The system confdir is what you usually want to use, since you will usually run Puppet's commands and
22+
services as root or `puppet`. (Note that admin commands like `puppetserver ca` must be run with `sudo`
23+
to use the same confdir as Puppet agent or Puppet master.)
2224

2325
> **Note:** When Puppet master is running as a Rack application, the `config.ru` file must explicitly set `--confdir` to the system confdir. The example `config.ru` file provided with the Puppet source does this.
2426
2527
{:.section}
2628
### Configuration
2729

28-
Puppet's confdir can be specified on the command line with the `--confdir` option, but it can't be set via puppet.conf. (This is because it needs the `confdir` to even find the config file.) If `--confdir` isn't specified when a Puppet application is started, it will always use the default confdir location.
30+
Puppet's confdir can be specified on the command line with the `--confdir` option, but it can't be set
31+
via puppet.conf. (This is because it needs the `confdir` to even find the config file.) If `--confdir`
32+
isn't specified when a Puppet application is started, it will always use the default confdir location.
2933

30-
Puppet Server uses the `jruby-puppet.master-conf-dir` setting [in puppetserver.conf][puppetserver_conf] to configure its confdir. Note that if you're using a non-default confdir, you must also specify `--confdir` whenever you run commands like `puppet module` or `puppet cert` to ensure they use the same directories as Puppet Server.
34+
Puppet Server uses the `jruby-puppet.master-conf-dir` setting [in puppetserver.conf][puppetserver_conf]
35+
to configure its confdir. Note that if you're using a non-default confdir, you must also specify
36+
`--confdir` whenever you run commands like `puppet module` to ensure they use the same directories as
37+
Puppet Server.
3138

3239
{:.concept}
3340
## Interpolation of `$confdir`

docs/_openvox_8x/dirs_ssldir.markdown

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,10 @@ The `ssldir` has the following structure:
8989
* `crl.pem` --- A copy of the certificate revocation list (CRL) retrieved from the CA, for use by Puppet agent or Puppet master. Mode: 0644. Setting: [`hostcrl`][hostcrl].
9090
* `private` _(directory)_ --- Usually does not contain any files. Mode: 0750. Setting: [`privatedir`][privatedir].
9191
* `password` --- The password to a node's private key. Usually not present. The conditions in which this file would exist are not defined. Mode: 0640. Setting: [`passfile`][passfile].
92-
* `private_keys` _(directory)_ --- Contains any private keys present on this node. This should generally only include the node's own private key, although on the CA it might also contain any private keys created by the `puppet cert generate` command. It will never contain the private key for the CA certificate. Mode: 0750. Setting: [`privatekeydir`][privatekeydir].
92+
* `private_keys` _(directory)_ --- Contains any private keys present on this node. This should generally
93+
only include the node's own private key, although on the CA it might also contain any private keys
94+
created by the `puppetserver ca generate` command. It will never contain the private key for the CA
95+
certificate. Mode: 0750. Setting: [`privatekeydir`][privatekeydir].
9396
* `<certname>.pem` --- This node's private key. Mode: 0600. Setting: [`hostprivkey`][hostprivkey].
9497
* `public_keys` _(directory)_ --- Contains any public keys generated by this node in preparation for generating a CSR. Mode: 0755. Setting: [`publickeydir`][publickeydir].
9598
* `<certname>.pem` --- This node's public key. Mode: 0644. Setting: [`hostpubkey`][hostpubkey].

docs/_openvox_8x/dirs_vardir.markdown

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ The cache directory for Puppet agent and Puppet apply can be found at one of the
2222

2323
When Puppet is running as either root, a Windows user with administrator privileges, or the `puppet` user, it will use a system-wide cache directory. When running as a non-root user, it will use a cache directory in that user's home directory.
2424

25-
The system cache directory is what you usually want to use, since you will usually run Puppet's commands and services as root or `puppet`. (Note that admin commands like `puppet cert` must be run with `sudo` to use the same directories as Puppet agent or Puppet master.)
25+
The system cache directory is what you usually want to use, since you will usually run Puppet's commands
26+
and services as root or `puppet`. (Note that admin commands like `puppetserver ca` must be run with
27+
`sudo` to use the same directories as Puppet agent or Puppet master.)
2628

2729
> **Note:** When Puppet master is running as a Rack application, the `config.ru` file must explicitly set `--vardir` to the system cache directory. The example `config.ru` file provided with the Puppet source does this.
2830

docs/_openvox_8x/http_api/http_certificate_status.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@ Find
2222
GET /puppet-ca/v1/certificate_status/:certname?environment=:environment
2323
Accept: application/json, text/pson
2424

25-
Retrieve information about the specified certificate. Similar to `puppet
26-
cert --list :certname`.
25+
Retrieve information about the specified certificate. Similar to `puppetserver
26+
ca list --certname :certname`.
2727

2828
Search
2929
-----
3030

3131
GET /puppet-ca/v1/certificate_statuses/:any_key?environment=:environment
3232
Accept: application/json, text/pson
3333

34-
Retrieve information about all known certificates. Similar to `puppet
35-
cert --list --all`. A key is required but is ignored.
34+
Retrieve information about all known certificates. Similar to `puppetserver
35+
ca list --all`. A key is required but is ignored.
3636

3737
Save
3838
----
@@ -43,9 +43,9 @@ Save
4343
Change the status of the specified certificate. The desired state
4444
is sent in the body of the PUT request as a one-item PSON hash; the two
4545
allowed complete hashes are `{"desired_state":"signed"}` (for signing a
46-
certificate signing request; similar to `puppet cert --sign`) and
46+
certificate signing request; similar to `puppetserver ca sign`) and
4747
`{"desired_state":"revoked"}` (for revoking a certificate; similar to
48-
`puppet cert --revoke`).
48+
`puppetserver ca revoke`).
4949

5050
Note that revoking a certificate will not clean up other info about the
5151
host - see the DELETE request for more information.
@@ -59,7 +59,7 @@ Delete
5959
Cause the certificate authority to discard all SSL information regarding
6060
a host (including any certificates, certificate requests, and keys).
6161
This does not revoke the certificate if one is present; if you wish to
62-
emulate the behavior of `puppet cert --clean`, you must PUT a
62+
emulate the behavior of `puppetserver ca clean`, you must PUT a
6363
`desired_state` of `revoked` before deleting the host’s SSL information.
6464

6565
If the deletion was successful, it returns a string listing the deleted

docs/_openvox_8x/quick_start_master_agent_communication.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ From the command line on your Puppet master, run:
3939

4040
From the command line on each Puppet agent, run `puppet agent -t`.
4141

42-
From your Puppet master, run `puppet cert list` and then `puppet cert sign <AGENT NAME>` to sign the certificates of your Puppet agents.
42+
From your Puppet Server, run `puppetserver ca list` and then `puppetserver ca sign --certname <AGENT NAME>` to sign the certificates of your Puppet agents.
4343

4444
> That’s it! Your Puppet configuration is ready to go.
4545

docs/_openvox_8x/ssl_attributes_extensions.markdown

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ See the respective sections below for information about how each hash is used an
5555

5656
### Default behavior
5757

58-
The `puppet cert list` command doesn't display custom attributes for pending CSRs, and [basic autosigning (autosign.conf)][autosign_basic] doesn't check them before signing.
58+
The `puppetserver ca list` command doesn't display custom attributes for pending CSRs, and [basic autosigning (autosign.conf)][autosign_basic] doesn't check them before signing.
5959

6060
### Configurable behavior
6161

@@ -65,7 +65,7 @@ The simplest use is to embed a pre-shared key of some kind in the custom attribu
6565

6666
A more complex use might be to embed an instance-specific ID and write a policy executable that can check it against a list of your recently requested instances on a public cloud, like EC2 or GCE.
6767

68-
If you use Puppet Server 2.5.0 or newer, you can also sign requests using authorization extensions and the `--allow-authorization-extensions` flag for `puppet cert sign`.
68+
You can also sign requests using authorization extensions and the `--allow-authorization-extensions` flag for `puppetserver ca sign`.
6969

7070
### Manually checking for custom attributes in CSRs
7171

@@ -108,8 +108,10 @@ See [the page on facts and special variables][trusted_hash] for more information
108108

109109
Visibility of extensions is somewhat limited:
110110

111-
* The `puppet cert list` command _does not_ display custom attributes for any pending CSRs, and [basic autosigning (autosign.conf)][autosign_basic] doesn't check them before signing. Either use [policy-based autosigning][autosign_policy] or inspect CSRs manually with the `openssl` command (see below).
112-
* The `puppet cert print` command _does_ display any extensions in a signed certificate, under the "X509v3 extensions" section.
111+
* The `puppetserver ca list` command _does not_ display custom attributes for any pending CSRs, and
112+
[basic autosigning (autosign.conf)][autosign_basic] doesn't check them before signing. Either use
113+
[policy-based autosigning][autosign_policy] or inspect CSRs manually with the `openssl` command (see below).
114+
* The `puppet ssl show` command displays any extensions in the local node's signed certificate, under the "X509v3 extensions" section.
113115

114116
Puppet's authorization system (`auth.conf`) does not use certificate extensions, but [Puppet Server's authorization system](/puppetserver/latest/config_file_auth.html), which is based on `trapperkeeper-authorization`, can use extensions in the ppAuthCertExt OID range, and requires them for requests to write access rules.
115117

@@ -141,7 +143,9 @@ Note that every extension is preceded by any combination of two characters (`.$`
141143

142144
Any Puppet-specific OIDs (see below) appear as numeric strings when using OpenSSL.
143145

144-
You can check for extensions in a signed certificate by running `puppet cert print <name>`. In the output, look for the "X509v3 extensions" section. Any of the Puppet-specific registered OIDs (see below) appear as their descriptive names:
146+
You can check for extensions in a signed certificate by running `puppet ssl show` on the agent node
147+
that holds the certificate. In the output, look for the "X509v3 extensions" section. Any of the
148+
Puppet-specific registered OIDs (see below) appear as their descriptive names:
145149

146150
```
147151
X509v3 extensions:
@@ -221,7 +225,8 @@ To start over, do the following:
221225

222226
**On the CA Puppet master:**
223227

224-
* Check whether a signed certificate exists; use `puppet cert list --all` to see the complete list. If it exists, revoke and delete it with `puppet cert clean <name>`.
228+
* Check whether a signed certificate exists; use `puppetserver ca list --all` to see the complete list.
229+
If it exists, revoke and delete it with `puppetserver ca clean --certname <name>`.
225230
* Check whether a CSR for the node exists; it will be in `$ssldir/ca/requests/<name>.pem`. If it exists, delete it.
226231

227232
After you've done that, you can start over.

0 commit comments

Comments
 (0)