Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ WORKDIR /go/src/tlstools

RUN go mod download

RUN apt-get update && apt install -y nmap

RUN CGO_ENABLED=0 go build ./cmd/tlstools

RUN CGO_ENABLED=0 go build ./cmd/tlstools-cli
Expand All @@ -17,15 +15,13 @@ RUN CGO_ENABLED=0 go build ./cmd/tlstools-cli
FROM debian:bookworm AS base

RUN apt-get update && apt upgrade -y \
&& apt-get install -y nmap \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN useradd -r appuser

COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=ghcr.io/jsandas/debian-weakkeys /usr/share/openssl-blacklist/* /opt/tlstools/resources/weakkeys/
COPY resources/nmap /opt/tlstools/resources/nmap

USER appuser

Expand Down
5 changes: 2 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@ go 1.26.0

require (
github.com/TwiN/go-color v1.4.1
github.com/Ullaakut/nmap/v2 v2.2.2
github.com/go-chi/chi/v5 v5.3.1
github.com/go-chi/render v1.0.3
github.com/jsandas/etls v0.1.2
github.com/jsandas/gologger v0.0.0-20220724041954-4d8e63f0a712
github.com/jsandas/tls-vuln-checker v0.0.0-20260719030845-59213241f699
golang.org/x/crypto v0.54.0
)

require (
github.com/ajg/form v1.8.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
golang.org/x/sync v0.3.0 // indirect
github.com/jsandas/starttls-go v1.0.1 // indirect
golang.org/x/sys v0.47.0 // indirect
)
16 changes: 4 additions & 12 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
github.com/TwiN/go-color v1.4.1 h1:mqG0P/KBgHKVqmtL5ye7K0/Gr4l6hTksPgTgMk3mUzc=
github.com/TwiN/go-color v1.4.1/go.mod h1:WcPf/jtiW95WBIsEeY1Lc/b8aaWoiqQpu5cf8WFxu+s=
github.com/Ullaakut/nmap/v2 v2.2.2 h1:178Ety3d8T21sF6WZxyj7QVZUhnC1tL1J+tHLLW507Q=
github.com/Ullaakut/nmap/v2 v2.2.2/go.mod h1:/6YyiW1Rgn7J6DAWCgL4CZZf6zJCFhB07PQzvjFfzLI=
github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY=
github.com/ajg/form v1.8.0 h1:kuvZgwcyDPMm4iFbTQUlg5W3leb5KcL+0lq+8FlvbJ0=
github.com/ajg/form v1.8.0/go.mod h1:HL757PzLyNkj5AIfptT6L+iGNeXTlnrr/oDePGc/y7Q=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/go-chi/chi/v5 v5.3.1 h1:3j4HZLGZQ3JpMCrPJF/Jl3mYJfWLKBfNJ6quurUGCf8=
Expand All @@ -16,22 +13,17 @@ github.com/jsandas/etls v0.1.2 h1:2H/2ERs+oGCOFfww8xH84S6aKsbmS4CiDH5ytnUxZk8=
github.com/jsandas/etls v0.1.2/go.mod h1:7DsHIwBnMQAb0+QzV8Jb+lCJdebQ4091q2FTWdSWfcE=
github.com/jsandas/gologger v0.0.0-20220724041954-4d8e63f0a712 h1:5pPQlZcqmMFlc8u/Ey9nptY6lUDHKIlgzVL02AviGFA=
github.com/jsandas/gologger v0.0.0-20220724041954-4d8e63f0a712/go.mod h1:2hfy33/xeFKZ7IbPgV/zJug8UyY8tbPHoJaJy8rvfrk=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/jsandas/starttls-go v1.0.1 h1:DTCil8+gxVnJlUfJhmfxJMkw6tdIRNRIwKg4rfX6cms=
github.com/jsandas/starttls-go v1.0.1/go.mod h1:8rDGnKnQzjlklSUrFapPjIruWb32Zi6Mq7sZrJ3XKHs=
github.com/jsandas/tls-vuln-checker v0.0.0-20260719030845-59213241f699 h1:oaAtuYqUBkdCqzR6AOdVqW1sluWFoT9+RV8LThx6rws=
github.com/jsandas/tls-vuln-checker v0.0.0-20260719030845-59213241f699/go.mod h1:2wD8eiwmPgtuAD6hCaYxwMEIU4hcsHncxS6vQJwTuUA=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
golang.org/x/crypto v0.54.0 h1:YLIA59K4fiNzHzjnZt2tUJQjQtUWfWbeHBqKtk3eScw=
golang.org/x/crypto v0.54.0/go.mod h1:KWL8ny2AZdGR2cWmzeHrp2azQPGogOv+HeQaVEXC2dk=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E=
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs=
golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
12 changes: 6 additions & 6 deletions pkg/scanner/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import (
"sync"

logger "github.com/jsandas/gologger"
"github.com/jsandas/tls-vuln-checker/vulnerabilities/ccs"
"github.com/jsandas/tls-vuln-checker/vulnerabilities/debianweakkey"
"github.com/jsandas/tls-vuln-checker/vulnerabilities/heartbleed"
"github.com/jsandas/tlstools/pkg/certutil"
"github.com/jsandas/tlstools/pkg/ssl"
"github.com/jsandas/tlstools/pkg/ssl/status"
"github.com/jsandas/tlstools/pkg/utils"
"github.com/jsandas/tlstools/pkg/utils/tcputils"
"github.com/jsandas/tlstools/pkg/vuln/ccs"
"github.com/jsandas/tlstools/pkg/vuln/heartbleed"
"github.com/jsandas/tlstools/pkg/vuln/weakkey"
)

func getCertData(cList []*x509.Certificate, ocspStaple []byte) []certutil.CertData {
Expand Down Expand Up @@ -86,9 +86,9 @@ type ConfigurationData struct {

// Vulnerabilities struct of vuln results
type Vulnerabilities struct {
DebianWeakKey weakkey.DebianWeakKey `json:"debianWeakKey"`
Heartbleed heartbleed.Heartbleed `json:"heartbleed"`
CCSInjection ccs.CCSInjection `json:"ccsinjection"`
DebianWeakKey debianweakkey.DebianWeakKey `json:"debianWeakKey"`
Heartbleed heartbleed.Heartbleed `json:"heartbleed"`
CCSInjection ccs.CCSInjection `json:"ccsinjection"`
}

// ScanConfiguration is performs tls certificate and conn checks
Expand Down
2 changes: 1 addition & 1 deletion pkg/scanner/scanner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func TestScanConfiguration(t *testing.T) {

cd.ScanConfiguration(host, port)

if len(cd.SupportedConfig) != 4 {
if len(cd.SupportedConfig) != 2 {
t.Errorf("wrong config length, got: %d, want: %d.", len(cd.SupportedConfig), 2)
}
Comment thread
jsandas marked this conversation as resolved.
}
Expand Down
6 changes: 0 additions & 6 deletions pkg/vuln/ccs/README.md

This file was deleted.

82 changes: 0 additions & 82 deletions pkg/vuln/ccs/ccs.go

This file was deleted.

34 changes: 0 additions & 34 deletions pkg/vuln/ccs/ccs_test.go

This file was deleted.

11 changes: 0 additions & 11 deletions pkg/vuln/heartbleed/README.md

This file was deleted.

Loading