crtsh-exporter

command module
v0.0.0-...-397a539 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

README

Prometheus Exporter for crt.sh

build Go Reference Go Report Card

  • ghcr.io/dazwilkin/crtsh-exporter:d928a7430c92e986ad57fad8f29b7ee481a614a3

Example

HOST="..."

curl \
--silent \
--get \
--data-urlencode "q=${HOST}" \
--data-urlencode "output=json" \
https://crt.sh

Returns

[
    {
        "issuer_ca_id": 123456,
        "issuer_name": "C=US, O=Let's Encrypt, CN=R3",
        "common_name": "{HOST}",
        "name_value": "{HOST}",
        "id": 10123456789,
        "entry_timestamp": "2023-01-01T23:59:59.000",
        "not_before": "2023-01-01T23:59:59",
        "not_after": "2023-01-01T23:59:59",
        "serial_number": "123456789abcdef0123456789abcdef0"
    }
]

Run

HOSTS="{host1}.{domain1},{host2}.{domain2},..."

HOST_PORT="8080"
CONT_PORT="8080"

podman run \
--interactive --tty --rm \
--name=crtsh-exporter \
--publish=${HOST_PORT}:${CONT_PORT}/tcp \
ghcr.io/dazwilkin/crtsh-exporter:d928a7430c92e986ad57fad8f29b7ee481a614a3 \
--hosts=${HOSTS} \
--endpoint=:${CONT_PORT} \
--path=/metrics

Prometheus

VERS="v2.46.0"

# Binds to host network to scrape crt.sh Exporter
podman run \
--interactive --tty --rm \
--net=host \
--volume=${PWD}/prometheus.yml:/etc/prometheus/prometheus.yml \
--volume=${PWD}/rules.yml:/etc/alertmanager/rules.yml \
quay.io/prometheus/prometheus:${VERS} \
  --config.file=/etc/prometheus/prometheus.yml \
  --web.enable-lifecycle

Metrics

Name Type Description
crtsh_exporter_build_info Counter A metric with a constant '1' value
crtsh_exporter_certificate_expiry Gauge Expiration ("not after") timestamp of most recent record
crtsh_exporter_certificate_records Gauge Number of Certificate records, labeled by most recent record's metadata
crtsh_exporter_start_time Gauge Exporter start time in UNIX epoch

Sigstore

crtsh-exporter container images are signed by Sigstore and may be verified:

cosign verify \
--key=./cosign.pub \
ghcr.io/dazwilkin/crtsh-exporter:d928a7430c92e986ad57fad8f29b7ee481a614a3

NOTE cosign.pub may be downloaded here

To install cosign e.g.:

go install github.com/sigstore/cosign/cmd/cosign@latest

Similar Exporters



Buy Me A Coffee

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL