All Projects → breml → rootcerts

breml / rootcerts

Licence: other
Go package to embed the Mozilla Included CA Certificate List

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to rootcerts

kms-issuer
KMS issuer is a cert-manager Certificate Request controller that uses AWS KMS to sign the certificate request.
Stars: ✭ 43 (-44.16%)
Mutual labels:  certificates
azure-iiot-opc-vault-service
Azure Industrial IoT OPC Vault Service
Stars: ✭ 15 (-80.52%)
Mutual labels:  certificates
tl-create
tl-create is a cross-platform command line tool to create a X.509 trust list from various trust stores. (Keywords: CABFORUM, eIDAS, WebPKI)
Stars: ✭ 32 (-58.44%)
Mutual labels:  certificates
cassler
🕷️ 🕷️ 🕷️ Validate SSL Certificates around web
Stars: ✭ 55 (-28.57%)
Mutual labels:  certificates
certificate-expiry-monitor-controller
Certificate Expiry Monitor Controller monitors the expiration of TLS certificates used in Ingress.
Stars: ✭ 114 (+48.05%)
Mutual labels:  certificates
acmed
ACME (RFC 8555) client daemon
Stars: ✭ 121 (+57.14%)
Mutual labels:  certificates
sscg
Simple Signed Certificate Generator
Stars: ✭ 57 (-25.97%)
Mutual labels:  certificates
certificates
🎓 Generate event certificates easily
Stars: ✭ 50 (-35.06%)
Mutual labels:  certificates
airgap
Offline LiveUSB to generate and manage secret keys for things such as gpg, certificates, and cryptocurrency
Stars: ✭ 92 (+19.48%)
Mutual labels:  certificates
doomsday
x509 certificate expiration monitoring
Stars: ✭ 31 (-59.74%)
Mutual labels:  certificates
SecuritySample
(Android) Hide encrypted secret API keys in C/C++ code, retrieve and decrypt them via JNI. Google SafetyNet APIs example.
Stars: ✭ 49 (-36.36%)
Mutual labels:  certificates
learn-ssl
A set of example programs that demonstrate various OpenSSL functions and enable "learning by doing".
Stars: ✭ 15 (-80.52%)
Mutual labels:  certificates
ssl-cert-check
Check expiry dates of local and remote SSL certificates
Stars: ✭ 28 (-63.64%)
Mutual labels:  certificates
httpsbook
《深入浅出HTTPS:从原理到实战》代码示例、勘误、反馈、讨论
Stars: ✭ 77 (+0%)
Mutual labels:  certificates
webnettools
Web Net Tools is a web frontend for some useful command line tooling. It provides especially an web frontend for tools like testssl.sh and nmap.
Stars: ✭ 33 (-57.14%)
Mutual labels:  certificates
bowser
a smart, friendly, secure, and auditable ssh daemon
Stars: ✭ 44 (-42.86%)
Mutual labels:  certificates
upmail
Email notification hook for https://github.com/sourcegraph/checkup.
Stars: ✭ 62 (-19.48%)
Mutual labels:  certificates
prathimacode-hub
Hello everyone, Welcome to my GitHub README profile. Glad to see you here! Check out this repository to view my work and learn more about me. Don't just star it, fork it as well.📢✌️
Stars: ✭ 53 (-31.17%)
Mutual labels:  certificates
jota-cert-checker
Check SSL certificate expiration date of a list of sites.
Stars: ✭ 45 (-41.56%)
Mutual labels:  certificates
Certification
Certificates of Qualification in Software Engineering
Stars: ✭ 41 (-46.75%)
Mutual labels:  certificates

rootcerts

Go Reference Github Action Workflow - Update Mozilla Included CA Certificate List Go Report Card

Package rootcerts provides an embedded copy of the Mozilla Included CA Certificate List, more specifically the PEM of Root Certificates in Mozilla's Root Store with the Websites (TLS/SSL) Trust Bit Enabled. If this package is imported anywhere in the program and the crypto/x509 package cannot find the system certificate pool, it will use this embedded information.

This package should be used when one of the following conditions is met:

  1. the Go program is frequently updated (automated via CI) and distributed in a minimalistic form like a Docker container from scratch
  2. the Go program is run in an out of date environment like a poorly maintained or no longer updateable system (e.g. hardware appliances)

In all other cases, it is recommended to stick to the CA certificates maintained with the operating system.

Please consider the following advice if using this package:

  • Carefully read and understand the section Words of Caution ‒ or why you should not use this package
    • Without update of your Go Module depencies, rebuilding and redeploying of your programm, there is no update to the embedded root certificates.
  • Do not include this package in any library package. This package should only be included in package main of programs.

The functionality of this package is proposed for inclusion into the Go standard library in #43958.

Usage

To use this package, simply import in your program.

import (
    _ "github.com/breml/rootcerts"
)

If this package is imported anywhere in the program and the crypto/x509 package cannot find the system certificate pool, it will use this embedded information.

Additionally, the usage of this embedded information can be forced by setting the environment variable GO_ROOTCERTS_ENABLE=1 while running a program which includes this package.

Importing this package will increase the size of a program by about 250 KB.

This package should normally be imported by a program's main package, not by a library. Libraries generally shouldn't decide whether to include the "Mozilla Included CA Certificate List" in a program.

Use cases in detail

Docker Containers from Scratch

If one is building a Docker container from scratch, containing a Go program, there are usually two issues:

  1. Timezone data is missing
  2. CA certificates are missing

The first issue can be addressed with the time/tzdata package, introduced into the Go standard library with version 1.15. The second case can now be mitigated by this package.

Poorly maintained appliances

I'm mainly thinking of hardware appliances like small NAS (network attached storage) systems from vendors like QNAP or Synology when I use the word appliance. These systems are based on Linux in most cases and offer SSH access. This allows the user to run custom tools on these systems. Unfortunately, whenever the vendor of these systems decides to stop shipping firmware updates, the system certificates are also no longer updated and it is often difficult or even impossible to update the system certificates manually.

Therefore, it is a great advantage if a program like a tool built with Go embeds its own root certificates.

The following two properties of Go make it a really good candidate for building programs for hardware appliances:

  1. Go programs are statically linked and can be distributed by simply copying the executable.
  2. Go provides greate support for cross compiling for multiple CPU architectures.

Trustworthiness of the Mozilla Included CA Certificate List

Most operating systems as well as web browsers include a list of certificate authorities and the corrosponding root certificates that are trusted by default. Some major software vendors operate their own root programs and so does the Mozilla Foundation for their well known products like the Firefox web browser or Thunderbird email client.

In contrast to most of the other software vendors, Mozilla maintains its Included CA Certificate List publicly and distributes it under an open source license. This is also the reason why most of the Linux distributions, as well as other free unix derivates and wide spread tools, use this list of CA Certificates as part of their distribution.

Here some examples:

Additionally, Mozilla operates the Common CA Database (used/supported by other major software vendors). The Common CA Database describes it self as:

The Common CA Database (CCADB) is a repository of information about externally operated Certificate Authorities (CAs) whose root and intermediate certificates are included within the products and services of CCADB root store members.

To summarize: It is safe to say that the Mozilla Included CA Certificate List is well established and widely used. In fact, if your Go program is run on Linux or an other free Unix derivate, chances are high that the root certificates used by your program are already provided by the Mozilla Included CA Certificate List.

Words of Caution ‒ or why you should not use this package

The root certificates are the top-most certificates in the trust chain and used to ensure the trustworthiness of the certificates signed by them either directly (intermediate certificates) or indirectly (through intermediate certificates). As a user of this package, you have the obligation to double check the source as well as the integrity of the root certificates provided in this package. This is absolutely crucial and should not be taken lightly. All certificates that are validated by programs built upon this package, e.g. by using TLS for communication, rely on the trustworthiness of these root certificates.

Beside the issue of the trust you put into the certificates included in this package, there is another topic to keep in mind and that is how the certificates get updated.

In the "normal" case, where a Go program is run on a recent operating system, the certificates get updated whenever the operating system is updated (and a new version of the CA certificates is available).
With the use of this package, this stays true if both of the following conditions are met:

  • the crypto/x509 package is able to find the CA certificates on the system.
  • the environment variable GO_ROOTCERTS_ENABLE=1 is not set.

It is worth mentioning that the crypto/x509 package by default does not provide the necessary mechanics to detect and reload the CA certificates if they change. By default, a restart of the Go program is necessary to leverage the updated certificates. Additionally the crypto/x509 package does not check the certificate revokation lists (CRL), when it is verifing the validity of certificates.

If the above conditions are not met, the CA certificates from this package are used. These certificates are only updated if all of the following conditions are met:

  • An updated list of certificates is available from Mozilla.
  • An updated version of this package, containing the updated certificates, is available.
  • The dependencies of the Go program are updated (go get -u github.com/breml/rootcerts).
  • A rebuilt version of the Go program is used

Inspiration

This package is heavily inspired by the time/tzdata package from the Go standard library.

Similar projects

License

Software: BSD 2-Clause “Simplified” License
Embedded certificates: MPL-2.0

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].