Version information
This version is compatible with:
- Puppet Enterprise 2023.8.x, 2023.7.x, 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x
- Puppet >= 7.0.0 < 9.0.0
- Archlinux , , , , , , , ,
Start using this module
Add this module to your Puppetfile:
mod 'puppet-ca_cert', '3.1.0'
Learn more about managing modules with a PuppetfileDocumentation
ca_cert puppet module
Table of Contents
- Description - What does the module do?
- Setup - The basics of getting started with mongodb
- Usage - Configuration options and additional functionality
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
Description
The ca_cert module tries to provide a simple way to manage Certificate Authority (CA) certificates on a Linux system.
Usage
On supported OSes custom and OS default CAs can be managed by using the defined type ca_cert::ca. The ca_cert class could be realized to costomize how this module manages the certificates.
Install a custom CA
ca_cert::ca { 'myorg_ca':
source => 'https://ca.myorg.com/myorg_ca.pem',
}
Manage custom CAs with hiera
---
ca_cert::ca_certs:
'myorg_ca':
source: 'https://ca.myorg.com/myorg_ca.pem'
include ca_cert
Distrust a OS default CA
Distrusting OS default CAs is handled differently by different OS families. On Debian/Ubuntu like OSes that support distrusting by using a configuration file the certificate content is not needed. Simply use
ca_cert::ca { 'DigiCert_Global_Root_G3':
ensure => 'distrusted',
}
On RedHat like OSes that use a folder to manage distrusted default CAs, the certificate source or content has to be provided as well
ca_cert::ca { 'DigiCert_Global_Root_G3':
ensure => 'distrusted',
source => 'https://cacerts.digicert.com/DigiCertGlobalRootG3.crt.pem',
}
Ensuring only puppet managed custom CAs are present
class { 'ca_cert':
purge_unmanaged_CAs => true,
ca_certs => {
....
}
}
Limitations
This module has been tested on operating systems in metadata.json
Development
This module is maintained by Vox Pupuli. Voxpupuli welcomes new contributions to this module, especially those that include documentation and rspec tests. We are happy to provide guidance if necessary.
Please see CONTRIBUTING for more details.
Transfer Notice
This module was originally authored by Phil Fenstermacher. The maintainer preferred that Puppet Community take ownership of the module for future improvement and maintenance. Existing pull requests and issues were transferred over, please fork and continue to contribute here instead.
Previously: https://github.com/pcfens/puppet-ca_cert
Reference
Table of Contents
Classes
ca_cert
: This module manages the shared system-wide truststore.
Defined types
ca_cert::ca
: Manage a CA Certificate in the the shared system-wide truststore.
Classes
ca_cert
This module manages the shared system-wide truststore.
Examples
Basic usage
class { 'ca_cert': }
Purge unmanaged user CAs
class { 'ca_cert':
purge_unmanaged_CAs => true,
}
Custom certificates handling
class { 'ca_cert':
update_cmd => '/usr/bin/c_rehash',
trusted_cert_dir => '/var/ssl/certs,
cert_dir_group => 'system',
cert_dir_mode => '0755',
ca_file_group => 'system',
ca_file_mode => '0644',
ca_file_extension => 'pem',
}
Parameters
The following parameters are available in the ca_cert
class:
update_cmd
trusted_cert_dir
distrusted_cert_dir
ca_certificates_conf
install_package
package_ensure
package_name
cert_dir_group
cert_dir_mode
ca_file_group
ca_file_mode
ca_file_extension
always_update_certs
purge_unmanaged_CAs
ca_certs
update_cmd
Data type: String[1]
Command to be used to update CA certificates. Default provided by Hiera for supported Operating Systems.
trusted_cert_dir
Data type: Stdlib::Absolutepath
Absolute directory path to the folder containing trusted certificates. Default provided by Hiera for supported Operating Systems.
distrusted_cert_dir
Data type: Optional[Stdlib::Absolutepath]
Absolute directory path to the folder containing distrusted certificates. Default provided by Hiera for supported Operating Systems.
Default value: undef
ca_certificates_conf
Data type: Optional[Stdlib::Absolutepath]
Some distros use a configuration file to mark distrusted certificates. Default provided by Hiera for supported Operating Systems.
Default value: undef
install_package
Data type: Boolean
Whether or not this module should install the ca_certificates package. The package contains the system default (typically Mozilla) CA certificates, as well as the tools required for managing other installed CA certificates.
Default value: true
package_ensure
Data type: Stdlib::Ensure::Package
The ensure parameter to pass to the package resource.
Default value: 'installed'
package_name
Data type: String[1]
The name of the package(s) to be installed.
Default value: 'ca-certificates'
cert_dir_group
Data type: String[1]
The installed trusted certificate's POSIX group permissions. This uses the same syntax as Puppet's native file resource's "group" parameter.
Default value: 'root'
cert_dir_mode
Data type: Stdlib::Filemode
The installed trusted certificate's POSIX filesystem permissions. This uses the same syntax as Puppet's native file resource's "mode" parameter.
Default value: '0755'
ca_file_group
Data type: String[1]
The installed CA certificate's POSIX group permissions. This uses the same syntax as Puppet's native file resource's "group" parameter.
Default value: 'root'
ca_file_mode
Data type: Stdlib::Filemode
The installed CA certificate's POSIX filesystem permissions. This uses the same syntax as Puppet's native file resource's "mode" parameter.
Default value: '0644'
ca_file_extension
Data type: String[1]
File extenstion for the certificate.
Default value: 'crt'
always_update_certs
Data type: Boolean
Run the appropriate update CA certificates command for your operating system on every Puppet run whether it is needed or not.
Default value: false
purge_unmanaged_CAs
Data type: Boolean
When set to true (default: false), user installed CA certificates (in the appropriate directories) not managed by this module will be purged.
Default value: false
ca_certs
Data type: Hash
A hash of CA certificates that should be installed as part of the class declaration.
Default value: {}
Defined types
ca_cert::ca
Manage a CA Certificate in the the shared system-wide truststore.
Examples
ca_cert::ca { 'globalsign_org_intermediate':
source => 'http://secure.globalsign.com/cacert/gsorganizationvalsha2g2r1.crt',
}
Parameters
The following parameters are available in the ca_cert::ca
defined type:
ensure
Data type: Enum['present', 'absent', 'trusted', 'distrusted']
Whether or not the CA certificate should be on a system or not.
present
/absent
is used to manage local/none default CAs.trusted
/distrusted
is used to manage system CAs.
Default value: 'present'
allow_insecure_source
Data type: Boolean
Whether to allow insecure download or not.
Default value: false
source
Data type: Optional[String[1]]
A source certificate, which will be copied into place on the local system.
This attribute is mutually exclusive with content
Uri support, see puppet-archive.
Default value: undef
content
Data type: Optional[String[1]]
PEM formatted certificate content
This attribute is mutually exclusive with source
Default value: undef
checksum
Data type: Optional[String[1]]
The checksum of the file.
Default value: undef
checksum_type
Data type: Optional[String[1]]
The type of file checksum.
Default value: undef
proxy_server
Data type: Optional[String[1]]
Proxy address to use when accessing source
Default value: undef
proxy_type
Data type: Optional[String[1]]
Proxy type ( See `archive::proxy_type )
Default value: undef
Changelog
All notable changes to this project will be documented in this file. Each new release typically also includes the latest modulesync defaults. These should not affect the functionality of the module.
v3.1.0 (2024-06-25)
Implemented enhancements:
- replace create_resources() with iterator #115 (bastelfreak)
Merged pull requests:
- puppet-lint: validate parameter types&docs #114 (bastelfreak)
- cleanup spec tests & facterdb_string_keys: switch to strings #113 (bastelfreak)
v3.0.0 (2024-06-07)
Breaking changes:
- Support distrusting ca's on Debian; Changed ca_cert::ca parameter names and meaning #107 (h-haaks)
- Remove defaults for AIX and Solaris as we can't verify/maintain these #100 (h-haaks)
- Move and use params only in ca_certs class #99 (h-haaks)
- Drop EoL Suse support #97 (h-haaks)
- Drop support for EoL Ubuntu versions #88 (bastelfreak)
- Drop EoL EL support #87 (bastelfreak)
- Drop Puppet 4/5/6 support #86 (bastelfreak)
Implemented enhancements:
- Support proxy when downloading remote certificates #108 (h-haaks)
- Add SLES and OpenSUSE 15 support #104 (h-haaks)
- Add supported OSes #94 (h-haaks)
- Add RedHat 9, CentOS, Rocky and AlmaLinux support #93 (h-haaks)
- enable acceptance tests #89 (bastelfreak)
Merged pull requests:
- Cleanup before release #109 (h-haaks)
- Refactor ca_cert:ca unit tests to use on_supported_os #105 (h-haaks)
- Move OS specific data from params.pp into hiera #102 (h-haaks)
- Cleanup Debian defaults #101 (h-haaks)
- Remove ca_cert::update class #98 (h-haaks)
- Remove ca_cert::force_enable param; Remove ca_cert::enable class #95 (h-haaks)
- Remove PDK refs from metadata #92 (h-haaks)
- Remove litmus #91 (h-haaks)
Changelog
v2.5.0
- Add support for Kali Linux #82
- Switch to namespaced functions for stdlib #83
- Improve testing capabilities #79, #84
v2.4.0
- Support Puppet 8 by replacing references to legacy facts #75
- Add support for RHEL8 #73
- Add support for Solaris 11 #72
- Add support for AIX #71
- Use puppet/archive instead of remote_file #69
v2.3.2
- Fix dependency setting #70
v2.3.1
- Update stdlib dependency #68
v2.3.0
v2.2.0
- Allow
package_ensure
to be set to latest #62
v2.1.5
- Remove dependency on deprecated string check #59
v2.1.4
- Upgrade PDK
- Note support for puppetlabs/stdlib <= 7.0
v2.1.3
- Fix dependency issue with dropping certificate #55
v2.1.2
- Fix an accidental dependency cycle #50
v2.1.1
- Fix the package dependency when
install_package
is set to false #47 - Update the stdlib dependency constraint. #48
v2.1.0
- Enable vs. force-enable for RHEL versions 6 and older #45
v2.0.0
This release has potentially breaking changes
- Move type validation from validate_type to Puppet data types (removes support for Puppet 3) #42
v1.8.0
- Don't run enable_ca_trust on RHEL7 #37
v1.7.1
- Set better default folder permissions #37
v1.7.0
- CA File modes passed as parameters #33
- Use remote_file instead of exec with curl/wget #32
- Don't purge managed CAs #30
v1.6.1
v1.6.0
- Add SLES10 support (exodusftw) #22
* This Changelog was automatically generated by github_changelog_generator
Dependencies
- puppetlabs/stdlib (>= 9.0.0 < 10.0.0)
- puppet/archive (>= 6.0.0 < 8.0.0)
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright © [2012-2014] [Sergey Stankevich] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.