All Projects → zmap → Zlint

zmap / Zlint

Licence: apache-2.0
X.509 Certificate Linter focused on Web PKI standards and requirements.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Zlint

Certlint
X.509 certificate linter, written in Go
Stars: ✭ 60 (-68.42%)
Mutual labels:  linter, x509
Bodyclose
Analyzer: checks whether HTTP response body is closed and a re-use of TCP connection is not blocked.
Stars: ✭ 181 (-4.74%)
Mutual labels:  linter
Dart Basic Utils
A dart package for many helper methods fitting common situations
Stars: ✭ 153 (-19.47%)
Mutual labels:  x509
Deal
Design by contract for Python with static checker and tests' generation.
Stars: ✭ 164 (-13.68%)
Mutual labels:  linter
Cflint
Static code analysis for CFML (a linter)
Stars: ✭ 156 (-17.89%)
Mutual labels:  linter
Add Trailing Comma
A tool (and pre-commit hook) to automatically add trailing commas to calls and literals.
Stars: ✭ 168 (-11.58%)
Mutual labels:  linter
Kube Lint
A linter for Kubernetes resources with a customizable rule set
Stars: ✭ 152 (-20%)
Mutual labels:  linter
Pspki
PowerShell PKI Module
Stars: ✭ 189 (-0.53%)
Mutual labels:  x509
Eslint Config Standard
ESLint Config for JavaScript Standard Style
Stars: ✭ 2,229 (+1073.16%)
Mutual labels:  linter
Poetic
Automatically install and maintain ESLint, Prettier, EditorConfig and Airbnb rules for JavaScript, TypeScript and React.
Stars: ✭ 165 (-13.16%)
Mutual labels:  linter
Textlint
The pluggable natural language linter for text and markdown.
Stars: ✭ 2,158 (+1035.79%)
Mutual labels:  linter
Clippy Check
📎 GitHub Action for PR annotations with clippy warnings
Stars: ✭ 159 (-16.32%)
Mutual labels:  linter
Ue4 Style Guide
An attempt to make Unreal Engine 4 projects more consistent
Stars: ✭ 2,656 (+1297.89%)
Mutual labels:  linter
Misspell Fixer
Simple tool for fixing common misspellings, typos in source code
Stars: ✭ 154 (-18.95%)
Mutual labels:  linter
Flake8 Eradicate
Flake8 plugin to find commented out or dead code
Stars: ✭ 184 (-3.16%)
Mutual labels:  linter
Acmetool
🔒 acmetool, an automatic certificate acquisition tool for ACME (Let's Encrypt)
Stars: ✭ 1,882 (+890.53%)
Mutual labels:  x509
Sublimelinter
The code linting framework for Sublime Text 3
Stars: ✭ 1,920 (+910.53%)
Mutual labels:  linter
Pythonvscode
This extension is now maintained in the Microsoft fork.
Stars: ✭ 2,013 (+959.47%)
Mutual labels:  linter
Grunt Eslint
Validate files with ESLint
Stars: ✭ 189 (-0.53%)
Mutual labels:  linter
Diagnostic Languageserver
diagnostic language server integrate with linters
Stars: ✭ 186 (-2.11%)
Mutual labels:  linter

ZLint

CI Status Integration Tests Lint Status Go Report Card

ZLint is a X.509 certificate linter written in Go that checks for consistency with standards (e.g. RFC 5280) and other relevant PKI requirements (e.g. CA/Browser Forum Baseline Requirements).

It can be used as a command line tool or as a library integrated into CA software.

Requirements

ZLint requires Go 1.16.x or newer be installed. The command line setup instructions assume the go command is in your $PATH.

Lint Sources

Historically ZLint was focused on only RFC 5280 and v1.4.8 of the CA/Browser Forum baseline requirements. A detailed list of the original BR coverage can be found in this spreadsheet.

More recently ZLint has been restructured to make it easier to add lints based on other sources. While not complete, presently ZLint has lints sourced from:

By default ZLint will apply applicable lints from all sources but consumers may also customize which lints are used by including/exclduing specific sources.

Versioning and Releases

ZLint aims to follow semantic versioning. The addition of new lints will generally result in a MINOR version revision. Since downstream projects depend on lint results and names for policy decisions changes of this nature will result in MAJOR version revision.

Where possible we will try to make available a release candidate (RC) a week before finalizing a production ready release tag. We encourage users to test RC releases to provide feedback early enough for bugs to be addressed before the final release is made available.

Please subscribe to the ZLint Announcements mailing list to receive notifications of new releases/release candidates. This low-volumne announcements mailing list is only used for new ZLint releases and major project announcements, not questions/support/bug reports.

Command Line Usage

ZLint can be used on the command-line through a simple bundled executable ZLint as well as through ZCertificate, a more full-fledged command-line certificate parser that links against ZLint.

Example ZLint CLI usage:

go get github.com/zmap/zlint/v3/cmd/zlint
echo "Lint mycert.pem with all applicable lints"
zlint mycert.pem

echo "Lint mycert.pem with just the two named lints"
zlint -includeNames=e_mp_exponent_cannot_be_one,e_mp_modulus_must_be_divisible_by_8 mycert.pem

echo "List available lint sources"
zlint -list-lints-source

echo "Lint mycert.pem with all of the lints except for ETSI ESI sourced lints"
zlint -excludeSources=ETSI_ESI mycert.pem

See zlint -h for all available command line options.

Library Usage

ZLint can also be used as a library. To lint a certificate with all applicable lints is as simple as using zlint.LintCertificate with a parsed certificate:

import (
	"github.com/zmap/zcrypto/x509"
	"github.com/zmap/zlint/v3"
)

var certDER []byte = ...
parsed, err := x509.ParseCertificate(certDER)
if err != nil {
	// If x509.ParseCertificate fails, the certificate is too broken to lint.
	// This should be treated as ZLint rejecting the certificate
	log.Fatal("unable to parse certificate:", err)
}
zlintResultSet := zlint.LintCertificate(parsed)

To lint a certificate with a subset of lints (e.g. based on lint source, or name) filter the global lint registry and use it with zlint.LintCertificateEx:

import (
	"github.com/zmap/zcrypto/x509"
	"github.com/zmap/zlint/v3"
	"github.com/zmap/zlint/v3/lint"
)

var certDER []byte = ...
parsed, err := x509.ParseCertificate(certDER)
if err != nil {
	// If x509.ParseCertificate fails, the certificate is too broken to lint.
	// This should be treated as ZLint rejecting the certificate
	log.Fatal("unable to parse certificate:", err)
}

registry, err := lint.GlobalRegistry().Filter(lint.FilterOptions{
  ExcludeSources: []lint.LintSource{lint.EtsiEsi},
})
if err != nil {
	log.Fatal("lint registry filter failed to apply:", err)
}
zlintResultSet := zlint.LintCertificateEx(parsed, registry)

See the zlint command's source code for an example.

Extending ZLint

For information on extending ZLint with new lints see CONTRIBUTING.md

Zlint Users/Integrations

Pre-issuance linting is strongly recommended by the Mozilla root program. Here are some projects/CAs known to integrate with ZLint in some fashion:

Please submit a pull request to update the README if you are aware of another CA/project that uses zlint.

License and Copyright

ZMap Copyright 2021 Regents of the University of Michigan

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 LICENSE for the specific language governing permissions and limitations under the License.

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].