Skip to content

Commit bf80bb6

Browse files
committed
Initial commit.
0 parents  commit bf80bb6

File tree

18 files changed

+1320
-0
lines changed

18 files changed

+1320
-0
lines changed

.github/workflows/test.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: test
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Install Go
12+
uses: actions/setup-go@v1
13+
with:
14+
go-version: 1.13
15+
- name: Checkout code
16+
uses: actions/checkout@v1
17+
- name: Cache dependencies
18+
uses: actions/cache@v1
19+
with:
20+
path: ~/go/pkg/mod
21+
key: go-${{ hashFiles('**/go.sum') }}
22+
- name: Download dependencies
23+
run: go mod download
24+
- name: Test
25+
run: go test -race -covermode=atomic ./...

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Ignore all
2+
*
3+
4+
# Unignore all with extensions
5+
!*.*
6+
7+
# Unignore all dirs
8+
!*/
9+
10+
# Unignore Dockerfile
11+
!Dockerfile
12+
13+
# OS X garbage
14+
.DS_Store

Dockerfile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
FROM golang:1.13.5-alpine3.10 AS builder
2+
3+
RUN apk update && \
4+
apk upgrade && \
5+
apk add --no-cache git
6+
7+
WORKDIR /workdir
8+
9+
# Download the dependecies first for faster iterations
10+
COPY go.mod go.sum /workdir/
11+
RUN go mod download
12+
13+
COPY . /workdir/
14+
15+
# Set the version to the tag, otherwise use the commit hash
16+
RUN git describe --exact-match --tags HEAD > version || git rev-parse HEAD > version && cat version
17+
18+
RUN export VERSION=$(cat version) && \
19+
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -ldflags="-w -s -X main.version=${VERSION}" -o /workdir/ssllabs_exporter
20+
21+
# Create a "nobody" user for the next image
22+
RUN echo "nobody:x:65534:65534:Nobody:/:" > /etc_passwd
23+
24+
25+
26+
FROM scratch
27+
28+
COPY --from=builder /workdir/ssllabs_exporter /bin/ssllabs_exporter
29+
# Required for HTTPS requests done by the application
30+
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
31+
# Required to be able to run as a non-root user (nobody)
32+
COPY --from=builder /etc_passwd /etc/passwd
33+
34+
USER nobody
35+
36+
ENTRYPOINT ["/bin/ssllabs_exporter"]

Readme.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# SSLLabs exporter
2+
[![Release](https://img.shields.io/github/release/anas-aso/ssllabs_exporter.svg?style=flat)](https://github.com/anas-aso/ssllabs_exporter/releases/latest)
3+
[![Build Status](https://github.com/anas-aso/ssllabs_exporter/workflows/test/badge.svg)](https://github.com/anas-aso/ssllabs_exporter/actions)
4+
[![Go Report Card](https://goreportcard.com/badge/github.com/anas-aso/ssllabs_exporter)](https://goreportcard.com/report/github.com/anas-aso/ssllabs_exporter)
5+
6+
Getting deep analysis of the configuration of any SSL web server on the public Internet à la blackbox_exporter style.
7+
8+
This exporter relays the target server hostname to [SSLLabs API](https://www.ssllabs.com/ssltest), parses the result and export it as Prometheus metrics. It covers retries in case of failures and simplifies the assessment result.
9+
10+
## SSLLabs
11+
> SSL Labs is a non-commercial research effort, run by [Qualys](https://www.qualys.com/), to better understand how SSL, TLS, and PKI technologies are used in practice.
12+
13+
source: https://www.ssllabs.com/about/assessment.html
14+
15+
This exporter implements SSLLabs API client that would get you the same results as if you use the [web interface](https://www.ssllabs.com/ssltest/).
16+
17+
## Configuration
18+
ssllabs_exporter doesn't require any configuration file and the available flags can be found as below :
19+
```bash
20+
$ ssllabs_exporter --help
21+
usage: ssllabs_exporter [<flags>]
22+
23+
Flags:
24+
--help Show context-sensitive help (also try --help-long and --help-man).
25+
--listen-address=":19115" The address to listen on for HTTP requests.
26+
--timeout=300 Assessment timeout in seconds (including retries).
27+
--log-level=debug Printed logs level.
28+
--version Show application version.
29+
```
30+
31+
## Docker
32+
The Prometheus exporter is available as a [docker image](https://hub.docker.com/repository/docker/anasaso/ssllabs_exporter) :
33+
```
34+
docker run --rm -it anasaso/ssllabs_exporter:latest --help
35+
```
36+
37+
## How To Use it
38+
Deploy the exporter to your infrastructure. Kubernetes deployment and service Yaml file are provided [here](examples/kubernetes) as an example.
39+
40+
Then adjust Prometheus config to add a new scrape configuration. Examples of how this look like can be found [here](examples/prometheus) (it includes both static config and Kubernetes service discovery to auto check all the cluster ingresses).
41+
42+
Once deployed, Prometheus Targets view page should look like this :
43+
![prometheus-targets-view](https://i.imgur.com/fJCun72.png "Prometheus Targets View")
44+
45+
The Grafana dashboard below is available [here](examples/grafana_dashboard.json).
46+
![grafana-dashboard](https://i.imgur.com/q71BpOa.png "Grafana Dashboard")

0 commit comments

Comments
 (0)