Contextual age scoring with stacking and SAN discount, directional multi-resolver DNS validation, surfaced fetch errors, and GPLv3 licensing
This commit is contained in:
parent
ced950004a
commit
a43faca0b1
26 changed files with 1613 additions and 93 deletions
|
|
@ -1,3 +1,8 @@
|
|||
// Copyright (C) 2026 Mark Robillard Jr (MARKMENTAL)
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License v3. See LICENSE.
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
// Package cert fetches leaf X.509 certificates and classifies the
|
||||
// CA/Browser Forum validation level from policy OIDs.
|
||||
// Mirrors bash get_cert_issuer / get_cert_sans / get_cert_class.
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
// Copyright (C) 2026 Mark Robillard Jr (MARKMENTAL)
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License v3. See LICENSE.
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
package cert
|
||||
|
||||
import (
|
||||
|
|
|
|||
|
|
@ -1,14 +1,15 @@
|
|||
// Copyright (C) 2026 Mark Robillard Jr (MARKMENTAL)
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License v3. See LICENSE.
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
// Package dns provides domain normalization, syntax validation,
|
||||
// and DNS pre-flight resolution checks.
|
||||
// and multi-resolver resolution checks.
|
||||
package dns
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net"
|
||||
"regexp"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
var domainRe = regexp.MustCompile(`^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?(\.[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)+$`)
|
||||
|
|
@ -35,18 +36,3 @@ func NormalizeDomain(d string) string {
|
|||
func ValidSyntax(d string) bool {
|
||||
return domainRe.MatchString(d)
|
||||
}
|
||||
|
||||
// CheckDNS aborts early on NXDOMAIN / unresolvable names.
|
||||
// Mirrors bash check_dns (dig +short A). Uses the stdlib resolver.
|
||||
func CheckDNS(ctx context.Context, domain string, timeout time.Duration) error {
|
||||
ctx, cancel := context.WithTimeout(ctx, timeout)
|
||||
defer cancel()
|
||||
addrs, err := net.DefaultResolver.LookupIP(ctx, "ip4", domain)
|
||||
if err != nil {
|
||||
return fmt.Errorf("domain '%s' failed DNS resolution (NXDOMAIN or offline): %w", domain, err)
|
||||
}
|
||||
if len(addrs) == 0 {
|
||||
return fmt.Errorf("domain '%s' failed DNS resolution (NXDOMAIN or offline): no addresses", domain)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
// Copyright (C) 2026 Mark Robillard Jr (MARKMENTAL)
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License v3. See LICENSE.
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
package dns
|
||||
|
||||
import "testing"
|
||||
|
|
|
|||
233
internal/dns/resolvers.go
Normal file
233
internal/dns/resolvers.go
Normal file
|
|
@ -0,0 +1,233 @@
|
|||
// Copyright (C) 2026 Mark Robillard Jr (MARKMENTAL)
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License v3. See LICENSE.
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
// Multi-resolver consistency checks: cross-validate the system resolver
|
||||
// against pinned public resolvers to catch split-brain DNS, local resolver
|
||||
// poisoning, or targeted routing manipulation.
|
||||
//
|
||||
// Only resolution *state* is compared, never raw A records: CDN and GeoDNS
|
||||
// fronting legitimately returns different IPs per egress geography, while
|
||||
// existence (live vs NXDOMAIN) and NS delegation stay stable. Tampering
|
||||
// requires two conclusive votes; timeouts and lookup errors abstain.
|
||||
package dns
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"sort"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
||||
// pinned public resolvers. Filtered resolvers (Quad9, OpenDNS) are
|
||||
// deliberately excluded: they alter answers by design and would
|
||||
// manufacture discrepancies.
|
||||
var pinnedServers = []struct {
|
||||
name string
|
||||
addr string
|
||||
}{
|
||||
{"1.1.1.1", "1.1.1.1:53"},
|
||||
{"8.8.8.8", "8.8.8.8:53"},
|
||||
}
|
||||
|
||||
// Consistency is the verdict of a multi-resolver cross-check.
|
||||
type Consistency struct {
|
||||
Checked bool
|
||||
Tampered bool
|
||||
Kind SplitKind
|
||||
Detail string
|
||||
}
|
||||
|
||||
// SplitKind names the direction of a resolution split. Suppression
|
||||
// (system dark, public live) signals local tampering; horizon
|
||||
// (system live, public dark) is the expected split-horizon shape for
|
||||
// internal names and never scores.
|
||||
type SplitKind int
|
||||
|
||||
const (
|
||||
SplitNone SplitKind = iota
|
||||
SplitSuppression
|
||||
SplitHorizon
|
||||
SplitNS
|
||||
)
|
||||
|
||||
type outcomeKind int
|
||||
|
||||
const (
|
||||
outcomeLive outcomeKind = iota
|
||||
outcomeNXDomain
|
||||
outcomeInconclusive
|
||||
)
|
||||
|
||||
type resolverOutcome struct {
|
||||
name string
|
||||
kind outcomeKind
|
||||
ns []string
|
||||
}
|
||||
|
||||
// pinnedResolver dials one DNS server directly, bypassing resolv.conf.
|
||||
func pinnedResolver(addr string) *net.Resolver {
|
||||
return &net.Resolver{
|
||||
PreferGo: true,
|
||||
Dial: func(ctx context.Context, network, _ string) (net.Conn, error) {
|
||||
var d net.Dialer
|
||||
return d.DialContext(ctx, network, addr)
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// DomainCheck is one domain's full probe: system liveness for gating,
|
||||
// public liveness for suppression attribution, and the aggregate verdict.
|
||||
type DomainCheck struct {
|
||||
SystemLive bool
|
||||
PublicLive bool
|
||||
Consistency Consistency
|
||||
}
|
||||
|
||||
// CheckDomain probes the system resolver and pinned public resolvers once
|
||||
// and returns everything callers need: gating votes plus the aggregate
|
||||
// consistency verdict. Query every resolver exactly once per domain.
|
||||
func CheckDomain(ctx context.Context, domain string, timeout time.Duration) DomainCheck {
|
||||
names := []string{"system"}
|
||||
resolvers := []*net.Resolver{net.DefaultResolver}
|
||||
for _, s := range pinnedServers {
|
||||
names = append(names, s.name)
|
||||
resolvers = append(resolvers, pinnedResolver(s.addr))
|
||||
}
|
||||
|
||||
outcomes := make([]resolverOutcome, len(resolvers))
|
||||
var wg sync.WaitGroup
|
||||
for i := range resolvers {
|
||||
wg.Add(1)
|
||||
go func(i int) {
|
||||
defer wg.Done()
|
||||
callCtx, cancel := context.WithTimeout(ctx, timeout)
|
||||
defer cancel()
|
||||
addrs, err := resolvers[i].LookupIP(callCtx, "ip4", domain)
|
||||
out := resolverOutcome{name: names[i], kind: classifyOutcome(addrs, err)}
|
||||
if out.kind == outcomeLive {
|
||||
if nss, nsErr := resolvers[i].LookupNS(callCtx, domain); nsErr == nil {
|
||||
for _, ns := range nss {
|
||||
out.ns = append(out.ns, normalizeNS(ns.Host))
|
||||
}
|
||||
}
|
||||
}
|
||||
outcomes[i] = out
|
||||
}(i)
|
||||
}
|
||||
wg.Wait()
|
||||
|
||||
var dc DomainCheck
|
||||
for _, o := range outcomes {
|
||||
if o.name == "system" && o.kind == outcomeLive {
|
||||
dc.SystemLive = true
|
||||
}
|
||||
if o.name != "system" && o.kind == outcomeLive {
|
||||
dc.PublicLive = true
|
||||
}
|
||||
}
|
||||
kind, detail := detectSplit(domain, outcomes)
|
||||
dc.Consistency = Consistency{Checked: true, Tampered: kind == SplitSuppression || kind == SplitNS, Kind: kind, Detail: detail}
|
||||
return dc
|
||||
}
|
||||
|
||||
// CheckConsistency queries the system resolver and pinned public resolvers
|
||||
// in parallel and reports state splits. Never fails closed: inconclusive
|
||||
// resolvers abstain, and agreement (or too few votes) is not tampering.
|
||||
func CheckConsistency(ctx context.Context, domain string, timeout time.Duration) Consistency {
|
||||
return CheckDomain(ctx, domain, timeout).Consistency
|
||||
}
|
||||
|
||||
// classifyOutcome maps a lookup result to live, NXDOMAIN, or inconclusive.
|
||||
// Anything that is not a clean answer or an authoritative NXDOMAIN abstains.
|
||||
func classifyOutcome(addrs []net.IP, err error) outcomeKind {
|
||||
if err != nil {
|
||||
var dnsErr *net.DNSError
|
||||
if errors.As(err, &dnsErr) && dnsErr.IsNotFound {
|
||||
return outcomeNXDomain
|
||||
}
|
||||
return outcomeInconclusive
|
||||
}
|
||||
if len(addrs) == 0 {
|
||||
return outcomeInconclusive
|
||||
}
|
||||
return outcomeLive
|
||||
}
|
||||
|
||||
// normalizeNS lowercases and strips the trailing root dot for comparison.
|
||||
func normalizeNS(host string) string {
|
||||
return strings.TrimSuffix(strings.ToLower(strings.TrimSpace(host)), ".")
|
||||
}
|
||||
|
||||
// nsSetsEqual compares normalized NS sets as sets, ignoring order.
|
||||
func nsSetsEqual(a, b []string) bool {
|
||||
if len(a) != len(b) {
|
||||
return false
|
||||
}
|
||||
set := make(map[string]int, len(a))
|
||||
for _, ns := range a {
|
||||
set[ns]++
|
||||
}
|
||||
for _, ns := range b {
|
||||
set[ns]--
|
||||
if set[ns] < 0 {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// detectSplit flags existence and NS-delegation splits across conclusive
|
||||
// resolver outcomes, with direction: system-dark/public-live is
|
||||
// suppression (local tampering shape), system-live/public-dark is the
|
||||
// split-horizon shape of internal names. Pure function; safe to unit test.
|
||||
func detectSplit(domain string, outcomes []resolverOutcome) (SplitKind, string) {
|
||||
sysKind := outcomeInconclusive
|
||||
var pubLive, pubNX []string
|
||||
var nsVotes [][]string
|
||||
var nsNames []string
|
||||
for _, o := range outcomes {
|
||||
if o.name == "system" {
|
||||
sysKind = o.kind
|
||||
}
|
||||
if o.name != "system" && o.kind == outcomeLive {
|
||||
pubLive = append(pubLive, o.name)
|
||||
}
|
||||
if o.name != "system" && o.kind == outcomeNXDomain {
|
||||
pubNX = append(pubNX, o.name)
|
||||
}
|
||||
if o.kind == outcomeLive && len(o.ns) > 0 {
|
||||
nsVotes = append(nsVotes, o.ns)
|
||||
nsNames = append(nsNames, o.name)
|
||||
}
|
||||
}
|
||||
if sysKind == outcomeNXDomain && len(pubLive) > 0 {
|
||||
sort.Strings(pubLive)
|
||||
return SplitSuppression, fmt.Sprintf("suppression pattern on %s: system reports NXDOMAIN while %s resolve live",
|
||||
domain, strings.Join(pubLive, ", "))
|
||||
}
|
||||
if sysKind == outcomeLive && len(pubNX) > 0 {
|
||||
sort.Strings(pubNX)
|
||||
return SplitHorizon, fmt.Sprintf("split-horizon pattern on %s: system resolves live while %s report NXDOMAIN",
|
||||
domain, strings.Join(pubNX, ", "))
|
||||
}
|
||||
if sysKind == outcomeInconclusive && len(pubLive) > 0 && len(pubNX) > 0 {
|
||||
sort.Strings(pubLive)
|
||||
sort.Strings(pubNX)
|
||||
return SplitSuppression, fmt.Sprintf("existence split on %s: %s report NXDOMAIN while %s resolve live (system inconclusive)",
|
||||
domain, strings.Join(pubNX, ", "), strings.Join(pubLive, ", "))
|
||||
}
|
||||
for i := 1; i < len(nsVotes); i++ {
|
||||
if !nsSetsEqual(nsVotes[0], nsVotes[i]) {
|
||||
sort.Strings(nsNames)
|
||||
return SplitNS, fmt.Sprintf("NS delegation split on %s across resolvers (%s)",
|
||||
domain, strings.Join(nsNames, ", "))
|
||||
}
|
||||
}
|
||||
return SplitNone, ""
|
||||
}
|
||||
115
internal/dns/resolvers_test.go
Normal file
115
internal/dns/resolvers_test.go
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
// Copyright (C) 2026 Mark Robillard Jr (MARKMENTAL)
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License v3. See LICENSE.
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
package dns
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"net"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestClassifyOutcome(t *testing.T) {
|
||||
live := classifyOutcome([]net.IP{net.ParseIP("93.184.216.34")}, nil)
|
||||
if live != outcomeLive {
|
||||
t.Errorf("addrs, no error = %v, want live", live)
|
||||
}
|
||||
nx := classifyOutcome(nil, &net.DNSError{Err: "no such host", IsNotFound: true})
|
||||
if nx != outcomeNXDomain {
|
||||
t.Errorf("not-found DNSError = %v, want nxdomain", nx)
|
||||
}
|
||||
timeout := classifyOutcome(nil, &net.DNSError{Err: "i/o timeout", IsTimeout: true})
|
||||
if timeout != outcomeInconclusive {
|
||||
t.Errorf("timeout DNSError = %v, want inconclusive", timeout)
|
||||
}
|
||||
generic := classifyOutcome(nil, errors.New("boom"))
|
||||
if generic != outcomeInconclusive {
|
||||
t.Errorf("generic error = %v, want inconclusive", generic)
|
||||
}
|
||||
empty := classifyOutcome(nil, nil)
|
||||
if empty != outcomeInconclusive {
|
||||
t.Errorf("empty answer = %v, want inconclusive", empty)
|
||||
}
|
||||
}
|
||||
|
||||
func TestNsSetsEqual(t *testing.T) {
|
||||
a := []string{"ns1.example.com", "ns2.example.com"}
|
||||
b := []string{"ns2.example.com", "ns1.example.com"}
|
||||
if !nsSetsEqual(a, b) {
|
||||
t.Error("same set, different order should be equal")
|
||||
}
|
||||
if nsSetsEqual(a, []string{"ns1.example.com"}) {
|
||||
t.Error("different cardinality should not be equal")
|
||||
}
|
||||
if nsSetsEqual(a, []string{"ns1.example.com", "ns9.example.com"}) {
|
||||
t.Error("different members should not be equal")
|
||||
}
|
||||
}
|
||||
|
||||
func TestDetectSplitSuppression(t *testing.T) {
|
||||
outcomes := []resolverOutcome{
|
||||
{name: "system", kind: outcomeNXDomain},
|
||||
{name: "1.1.1.1", kind: outcomeLive, ns: []string{"ns1.x"}},
|
||||
{name: "8.8.8.8", kind: outcomeInconclusive},
|
||||
}
|
||||
kind, detail := detectSplit("evil.test", outcomes)
|
||||
if kind != SplitSuppression {
|
||||
t.Fatalf("system-dark/public-live should be suppression, got %v", kind)
|
||||
}
|
||||
if !strings.Contains(detail, "1.1.1.1") || !strings.Contains(detail, "suppression") {
|
||||
t.Errorf("detail should name suppression, got %q", detail)
|
||||
}
|
||||
}
|
||||
|
||||
func TestDetectSplitHorizon(t *testing.T) {
|
||||
outcomes := []resolverOutcome{
|
||||
{name: "system", kind: outcomeLive, ns: []string{"ns1.x"}},
|
||||
{name: "1.1.1.1", kind: outcomeNXDomain},
|
||||
{name: "8.8.8.8", kind: outcomeNXDomain},
|
||||
}
|
||||
kind, detail := detectSplit("internal.test", outcomes)
|
||||
if kind != SplitHorizon {
|
||||
t.Fatalf("system-live/public-dark should be horizon, got %v", kind)
|
||||
}
|
||||
if !strings.Contains(detail, "split-horizon") {
|
||||
t.Errorf("detail should name split-horizon, got %q", detail)
|
||||
}
|
||||
}
|
||||
|
||||
func TestDetectSplitNS(t *testing.T) {
|
||||
outcomes := []resolverOutcome{
|
||||
{name: "system", kind: outcomeLive, ns: []string{"ns1.x"}},
|
||||
{name: "1.1.1.1", kind: outcomeLive, ns: []string{"ns9.y"}},
|
||||
}
|
||||
kind, detail := detectSplit("evil.test", outcomes)
|
||||
if kind != SplitNS {
|
||||
t.Fatalf("NS delegation split should be SplitNS, got %v", kind)
|
||||
}
|
||||
if !strings.Contains(detail, "NS delegation split") {
|
||||
t.Errorf("detail should name NS split, got %q", detail)
|
||||
}
|
||||
}
|
||||
|
||||
func TestDetectSplitAgreement(t *testing.T) {
|
||||
// Same NS everywhere, different A records (CDN) is not observable here
|
||||
// by design: only state and NS sets vote.
|
||||
agree := []resolverOutcome{
|
||||
{name: "system", kind: outcomeLive, ns: []string{"ns1.x"}},
|
||||
{name: "1.1.1.1", kind: outcomeLive, ns: []string{"ns1.x"}},
|
||||
{name: "8.8.8.8", kind: outcomeInconclusive},
|
||||
}
|
||||
if kind, _ := detectSplit("ok.test", agree); kind != SplitNone {
|
||||
t.Errorf("agreement should be SplitNone, got %v", kind)
|
||||
}
|
||||
thin := []resolverOutcome{
|
||||
{name: "system", kind: outcomeLive, ns: []string{"ns1.x"}},
|
||||
{name: "1.1.1.1", kind: outcomeInconclusive},
|
||||
{name: "8.8.8.8", kind: outcomeInconclusive},
|
||||
}
|
||||
if kind, _ := detectSplit("ok.test", thin); kind != SplitNone {
|
||||
t.Errorf("single conclusive vote should be SplitNone, got %v", kind)
|
||||
}
|
||||
}
|
||||
|
|
@ -1,3 +1,8 @@
|
|||
// Copyright (C) 2026 Mark Robillard Jr (MARKMENTAL)
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License v3. See LICENSE.
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
// Package rdap queries RDAP registration data via https://rdap.org/domain/.
|
||||
// Mirrors bash rdap_query / get_registration_date / get_registrar.
|
||||
package rdap
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
// Copyright (C) 2026 Mark Robillard Jr (MARKMENTAL)
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License v3. See LICENSE.
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
package rdap
|
||||
|
||||
import (
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
// Copyright (C) 2026 Mark Robillard Jr (MARKMENTAL)
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License v3. See LICENSE.
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
// Package report renders human, JSON, scale, and verbose output.
|
||||
// Mirrors bash render_human / render_json / render_scale / render_verbose,
|
||||
// plus the restored Validation line (per user decision).
|
||||
|
|
@ -32,14 +37,20 @@ type Data struct {
|
|||
|
||||
// Scale prints the scoring reference table (no lookups performed).
|
||||
func Scale(version string) string {
|
||||
return fmt.Sprintf(`isthislegit? [v%s] — Scoring Scale (max total: 150)
|
||||
return fmt.Sprintf(`isthislegit? [v%s] — Scoring Scale (max total: 200)
|
||||
|
||||
Signals:
|
||||
+-----------------------------------------------+--------+
|
||||
| Signal | Points |
|
||||
+-----------------------------------------------+--------+
|
||||
| Suspect domain age < 30 days (CRITICAL) | +80 |
|
||||
| Suspect domain age 30-89 days (WARNING) | +80 |
|
||||
| Suspect < 30d (CRITICAL), stacked w/ signal | +80 |
|
||||
| Suspect < 30d (CRITICAL), isolated | +40 |
|
||||
| Suspect 30-89d (WARNING), stacked w/ signal | +40 |
|
||||
| Suspect 30-89d (WARNING), isolated | +20 |
|
||||
| Shared cert infrastructure (halves age tier) | x0.5 |
|
||||
| Identical target/suspect (forced LEGITIMATE) | +0 |
|
||||
| DNS suppression split (suspect) | +50 |
|
||||
| DNS split-horizon/target-side (info) | +0 |
|
||||
| Cert downgrade: target EV/OV vs suspect DV | +40 |
|
||||
| Registrar mismatch | +30 |
|
||||
| Same-class issuer difference (display only) | +0 |
|
||||
|
|
@ -200,9 +211,25 @@ func Verbose(d Data) string {
|
|||
writeRDAP(d.TargetDomain, d.TargetRDAP)
|
||||
writeTLS(d.SuspectDomain, d.SuspectCert)
|
||||
writeRDAP(d.SuspectDomain, d.SuspectRDAP)
|
||||
writeDNS(&b, "Target", d.TargetDomain, d.Target.DNSTampered, d.Target.DNSDetail)
|
||||
writeDNS(&b, "Suspect", d.SuspectDomain, d.Suspect.DNSTampered, d.Suspect.DNSDetail)
|
||||
return b.String()
|
||||
}
|
||||
|
||||
// writeDNS renders the multi-resolver consistency verdict for one domain.
|
||||
func writeDNS(b *strings.Builder, label, domain string, tampered bool, detail string) {
|
||||
fmt.Fprintf(b, "--- DNS consistency (%s):\n", domain)
|
||||
if detail == "" {
|
||||
fmt.Fprintf(b, " consistent across resolvers (%s)\n\n", label)
|
||||
return
|
||||
}
|
||||
status := detail
|
||||
if tampered {
|
||||
status = "TAMPERED: " + detail
|
||||
}
|
||||
fmt.Fprintf(b, " %s\n\n", status)
|
||||
}
|
||||
|
||||
func classOf(c *cert.Details) string {
|
||||
if c == nil || c.Class == "" {
|
||||
return "Unknown"
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
// Copyright (C) 2026 Mark Robillard Jr (MARKMENTAL)
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License v3. See LICENSE.
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
package score
|
||||
|
||||
import (
|
||||
|
|
|
|||
|
|
@ -1,22 +1,33 @@
|
|||
// Copyright (C) 2026 Mark Robillard Jr (MARKMENTAL)
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License v3. See LICENSE.
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
// Package score implements the deterministic risk scoring logic.
|
||||
// It mirrors the bash implementation exactly (spec AGENTS.md section 4.4
|
||||
// as refined by the bash script: <30 and 30-89 both +80, downgrade only
|
||||
// EV/OV -> DV for +40, registrar mismatch +30 case-insensitive).
|
||||
// Age tiers (<30 CRITICAL, 30-89 WARNING) are contextual: full weight
|
||||
// needs company (registrar mismatch or cert downgrade), shared certificate
|
||||
// infrastructure halves the tier, and identical domains score zero.
|
||||
// Downgrade (EV/OV -> DV) is +40, registrar mismatch +30 case-insensitive.
|
||||
package score
|
||||
|
||||
import "fmt"
|
||||
import "strings"
|
||||
|
||||
import "isthislegit/internal/dns"
|
||||
|
||||
// DomainData holds the collected triage fields for one domain.
|
||||
type DomainData struct {
|
||||
Domain string
|
||||
Date string // YYYY-MM-DD or sentinel on failure
|
||||
Registrar string // "Unknown" when unavailable
|
||||
Issuer string // "Unknown" when unavailable
|
||||
Class string // EV, OV, IV, DV, or Unknown
|
||||
SANs string // comma-joined, or "Unknown"
|
||||
AgeDays int
|
||||
AgeKnown bool
|
||||
Domain string
|
||||
Date string // YYYY-MM-DD or sentinel on failure
|
||||
Registrar string // "Unknown" when unavailable
|
||||
Issuer string // "Unknown" when unavailable
|
||||
Class string // EV, OV, IV, DV, or Unknown
|
||||
SANs string // comma-joined, or "Unknown"
|
||||
AgeDays int
|
||||
AgeKnown bool
|
||||
DNSTampered bool // suppression/NS split (scores on suspect)
|
||||
DNSSplit dns.SplitKind // split direction (horizon never scores)
|
||||
DNSDetail string // human-readable split description
|
||||
}
|
||||
|
||||
// Result is the outcome of scoring a target/suspect pair.
|
||||
|
|
@ -67,27 +78,46 @@ func VerifyDataQuality(target, suspect DomainData) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// Score applies the three signals and maps the total to a verdict.
|
||||
// Score applies the signals and maps the total to a verdict.
|
||||
//
|
||||
// Age is contextual, not a binary cliff: identical domains force zero
|
||||
// with findings attached; shared certificate infrastructure halves the
|
||||
// tier; full tier needs company (registrar mismatch or cert downgrade),
|
||||
// with isolated domains scoring the next tier down.
|
||||
func Score(target, suspect DomainData) Result {
|
||||
var r Result
|
||||
|
||||
// Age check: suspect created < 90 days => +80.
|
||||
if suspect.AgeKnown {
|
||||
switch {
|
||||
case suspect.AgeDays < 30:
|
||||
r.Score += 80
|
||||
r.AgeFlag = " [CRITICAL: Domain created < 30 days ago]"
|
||||
r.Findings = append(r.Findings, fmt.Sprintf("HIGH RISK: Suspect domain created recently (%s).", suspect.Date))
|
||||
case suspect.AgeDays < 90:
|
||||
r.Score += 80
|
||||
r.AgeFlag = " [WARNING: Domain created < 90 days ago]"
|
||||
r.Findings = append(r.Findings, fmt.Sprintf("HIGH RISK: Suspect domain created recently (%s).", suspect.Date))
|
||||
if target.Domain != "" && strings.EqualFold(target.Domain, suspect.Domain) {
|
||||
r.Findings = append(r.Findings, "INFO: Target and suspect are identical — a domain cannot impersonate itself.")
|
||||
noteDNS(&r, target, "target")
|
||||
if suspect.DNSDetail != target.DNSDetail {
|
||||
noteDNS(&r, suspect, "suspect")
|
||||
}
|
||||
r.Verdict = Verdict(r.Score)
|
||||
return r
|
||||
}
|
||||
|
||||
// Cert validation downgrade: target EV/OV but suspect DV => +40.
|
||||
// Same-class issuer differences are display-only (no points).
|
||||
isDowngrade := (target.Class == "EV" || target.Class == "OV") && suspect.Class == "DV"
|
||||
mismatch := registrarMismatch(target, suspect)
|
||||
stacked := mismatch || isDowngrade
|
||||
sharedCert := sansOverlap(target, suspect)
|
||||
|
||||
// Age check with stacking and shared-infrastructure discount.
|
||||
if suspect.AgeKnown {
|
||||
switch {
|
||||
case suspect.AgeDays < 30:
|
||||
r.AgeFlag = " [CRITICAL: Domain created < 30 days ago]"
|
||||
r.Score += agePoints(80, stacked, sharedCert)
|
||||
r.Findings = append(r.Findings, ageFinding(suspect.Date, 80, stacked, sharedCert))
|
||||
case suspect.AgeDays < 90:
|
||||
r.AgeFlag = " [WARNING: Domain created < 90 days ago]"
|
||||
r.Score += agePoints(40, stacked, sharedCert)
|
||||
r.Findings = append(r.Findings, ageFinding(suspect.Date, 40, stacked, sharedCert))
|
||||
}
|
||||
}
|
||||
|
||||
if isDowngrade {
|
||||
r.Score += 40
|
||||
r.Findings = append(r.Findings, fmt.Sprintf("DOWNGRADE: Target uses %s (%s) while Suspect uses DV automated cert (%s).", target.Class, target.Issuer, suspect.Issuer))
|
||||
|
|
@ -97,17 +127,115 @@ func Score(target, suspect DomainData) Result {
|
|||
}
|
||||
|
||||
// Registrar mismatch => +30 (skipped when either side is unknown).
|
||||
if target.Registrar != "Unknown" && suspect.Registrar != "Unknown" && target.Registrar != "" && suspect.Registrar != "" {
|
||||
if !strings.EqualFold(target.Registrar, suspect.Registrar) {
|
||||
r.Score += 30
|
||||
r.Findings = append(r.Findings, fmt.Sprintf("MISMATCH: Registrars do not align (%s vs %s).", target.Registrar, suspect.Registrar))
|
||||
}
|
||||
if mismatch {
|
||||
r.Score += 30
|
||||
r.Findings = append(r.Findings, fmt.Sprintf("MISMATCH: Registrars do not align (%s vs %s).", target.Registrar, suspect.Registrar))
|
||||
}
|
||||
|
||||
// Resolution tampering => +50 on the suspect side for suppression and
|
||||
// NS splits. Split-horizon shapes describe split-horizon or observer
|
||||
// networks, never the suspect, so they stay display-only — as does
|
||||
// anything on the target side.
|
||||
if suspect.DNSTampered {
|
||||
r.Score += 50
|
||||
r.Findings = append(r.Findings, fmt.Sprintf("TAMPERING: Inconsistent DNS resolution for suspect (%s).", suspect.DNSDetail))
|
||||
}
|
||||
if suspect.DNSSplit == dns.SplitHorizon {
|
||||
r.Findings = append(r.Findings, fmt.Sprintf("NOTE: Split-horizon DNS for suspect (%s); resolves locally only.", suspect.DNSDetail))
|
||||
}
|
||||
noteDNS(&r, target, "target")
|
||||
|
||||
r.Verdict = Verdict(r.Score)
|
||||
return r
|
||||
}
|
||||
|
||||
// noteDNS appends display-only DNS findings for one side: tampering notes
|
||||
// observer-side suspicion, horizon notes split-horizon shape. No points.
|
||||
func noteDNS(r *Result, d DomainData, role string) {
|
||||
if d.DNSDetail == "" {
|
||||
return
|
||||
}
|
||||
if d.DNSTampered {
|
||||
r.Findings = append(r.Findings, fmt.Sprintf("NOTE: Inconsistent DNS resolution for %s (%s); observer-side network suspected.", role, d.DNSDetail))
|
||||
return
|
||||
}
|
||||
if d.DNSSplit == dns.SplitHorizon {
|
||||
r.Findings = append(r.Findings, fmt.Sprintf("NOTE: Split-horizon DNS for %s (%s); resolves locally only.", role, d.DNSDetail))
|
||||
}
|
||||
}
|
||||
|
||||
// registrarMismatch reports a case-insensitive registrar difference,
|
||||
// skipped when either side is unknown.
|
||||
func registrarMismatch(target, suspect DomainData) bool {
|
||||
known := func(s string) bool { return s != "" && s != "Unknown" }
|
||||
return known(target.Registrar) && known(suspect.Registrar) && !strings.EqualFold(target.Registrar, suspect.Registrar)
|
||||
}
|
||||
|
||||
// agePoints resolves an age tier to points: the full tier needs company
|
||||
// (stacked signals), otherwise the next tier down; shared certificate
|
||||
// infrastructure halves whatever remains.
|
||||
func agePoints(tier int, stacked, sharedCert bool) int {
|
||||
points := tier
|
||||
if !stacked {
|
||||
points /= 2
|
||||
}
|
||||
if sharedCert {
|
||||
points /= 2
|
||||
}
|
||||
return points
|
||||
}
|
||||
|
||||
// ageFinding words the age finding by final points, with the reason the
|
||||
// tier was reduced when it was.
|
||||
func ageFinding(date string, tier int, stacked, sharedCert bool) string {
|
||||
points := agePoints(tier, stacked, sharedCert)
|
||||
level := "LOW RISK"
|
||||
if points >= 80 {
|
||||
level = "HIGH RISK"
|
||||
}
|
||||
if points >= 40 && points < 80 {
|
||||
level = "ELEVATED RISK"
|
||||
}
|
||||
reason := ""
|
||||
if sharedCert {
|
||||
reason = " Shared certificate infrastructure with target."
|
||||
}
|
||||
if reason == "" && !stacked {
|
||||
reason = " No corroborating registrar or certificate signals."
|
||||
}
|
||||
return fmt.Sprintf("%s: Suspect domain created recently (%s).%s", level, date, reason)
|
||||
}
|
||||
|
||||
// sansOverlap reports shared certificate infrastructure: either domain
|
||||
// appearing in the other's SAN set, exactly or via a parent wildcard.
|
||||
// Unknown or empty SAN fields never match.
|
||||
func sansOverlap(target, suspect DomainData) bool {
|
||||
return sanCovers(suspect.SANs, target.Domain) || sanCovers(target.SANs, suspect.Domain)
|
||||
}
|
||||
|
||||
// sanCovers reports whether a comma-joined SAN field covers domain.
|
||||
func sanCovers(sansField, domain string) bool {
|
||||
domain = strings.ToLower(strings.TrimSpace(domain))
|
||||
if domain == "" {
|
||||
return false
|
||||
}
|
||||
for _, san := range strings.Split(sansField, ",") {
|
||||
san = strings.ToLower(strings.TrimSpace(san))
|
||||
if san == "" || san == "unknown" {
|
||||
continue
|
||||
}
|
||||
if san == domain {
|
||||
return true
|
||||
}
|
||||
if parent, ok := strings.CutPrefix(san, "*."); ok && parent != "" {
|
||||
if domain == parent || strings.HasSuffix(domain, "."+parent) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// isIssuerNote reports a display-only issuer difference: distinct known
|
||||
// issuers at comparable validation levels. Avoids false positives when both
|
||||
// sides legitimately use different DV CAs.
|
||||
|
|
|
|||
|
|
@ -1,8 +1,16 @@
|
|||
// Copyright (C) 2026 Mark Robillard Jr (MARKMENTAL)
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License v3. See LICENSE.
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
package score
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"isthislegit/internal/dns"
|
||||
)
|
||||
|
||||
func TestScorePhishing(t *testing.T) {
|
||||
|
|
@ -32,6 +40,80 @@ func TestScoreLegitimate(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestScoreWarningTier(t *testing.T) {
|
||||
target := DomainData{Domain: "a.com", Date: "2000-01-01", Registrar: "Same Inc.", Issuer: "Let's Encrypt", Class: "DV", SANs: "a.com", AgeDays: 9000, AgeKnown: true}
|
||||
suspect := DomainData{Domain: "b.com", Date: "2026-07-25", Registrar: "Same Inc.", Issuer: "Let's Encrypt", Class: "DV", SANs: "b.com", AgeDays: 45, AgeKnown: true}
|
||||
r := Score(target, suspect)
|
||||
if r.Score != 20 {
|
||||
t.Errorf("Score = %d, want 20 (isolated warning tier)", r.Score)
|
||||
}
|
||||
if got := Verdict(r.Score); got != "LIKELY UNRELATED / MISCONFIGURED" {
|
||||
t.Errorf("Verdict = %q", got)
|
||||
}
|
||||
if r.AgeFlag == "" {
|
||||
t.Error("expected AgeFlag for 30-89d domain")
|
||||
}
|
||||
found := false
|
||||
for _, f := range r.Findings {
|
||||
if strings.Contains(f, "LOW RISK") {
|
||||
found = true
|
||||
}
|
||||
if strings.Contains(f, "HIGH RISK") {
|
||||
t.Errorf("isolated warning tier must not emit HIGH RISK, got %q", f)
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
t.Errorf("expected LOW RISK finding, got %v", r.Findings)
|
||||
}
|
||||
}
|
||||
|
||||
func TestScoreWarningTierStacked(t *testing.T) {
|
||||
target := DomainData{Domain: "a.com", Date: "2000-01-01", Registrar: "Registrar A", Issuer: "Let's Encrypt", Class: "DV", SANs: "a.com", AgeDays: 9000, AgeKnown: true}
|
||||
suspect := DomainData{Domain: "b.com", Date: "2026-07-25", Registrar: "Registrar B", Issuer: "Let's Encrypt", Class: "DV", SANs: "b.com", AgeDays: 45, AgeKnown: true}
|
||||
r := Score(target, suspect)
|
||||
if r.Score != 70 {
|
||||
t.Errorf("Score = %d, want 70 (stacked warning 40 + registrar 30)", r.Score)
|
||||
}
|
||||
if got := Verdict(r.Score); got != "LIKELY PHISHING / IMPERSONATION ATTEMPT" {
|
||||
t.Errorf("Verdict = %q", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestScoreIdenticalDomains(t *testing.T) {
|
||||
a := DomainData{Domain: "same.com", Date: "2026-09-08", Registrar: "R", Issuer: "I", Class: "DV", SANs: "same.com", AgeDays: 1, AgeKnown: true}
|
||||
r := Score(a, a)
|
||||
if r.Score != 0 {
|
||||
t.Errorf("Score = %d, want 0 (identical domains)", r.Score)
|
||||
}
|
||||
if got := Verdict(r.Score); got != "LIKELY LEGITIMATE" {
|
||||
t.Errorf("Verdict = %q", got)
|
||||
}
|
||||
if len(r.Findings) != 1 || !strings.Contains(r.Findings[0], "INFO") {
|
||||
t.Errorf("expected single INFO finding, got %v", r.Findings)
|
||||
}
|
||||
}
|
||||
|
||||
func TestScoreSharedCertDiscount(t *testing.T) {
|
||||
target := DomainData{Domain: "corp.com", Date: "2000-01-01", Registrar: "Same Inc.", Issuer: "DigiCert Inc", Class: "OV", SANs: "corp.com", AgeDays: 9000, AgeKnown: true}
|
||||
suspect := DomainData{Domain: "new-corp.com", Date: "2026-09-01", Registrar: "Same Inc.", Issuer: "DigiCert Inc", Class: "OV", SANs: "new-corp.com, corp.com", AgeDays: 8, AgeKnown: true}
|
||||
r := Score(target, suspect)
|
||||
if r.Score != 20 {
|
||||
t.Errorf("Score = %d, want 20 (isolated critical 40 halved by shared cert)", r.Score)
|
||||
}
|
||||
}
|
||||
|
||||
func TestScoreCriticalUnstacked(t *testing.T) {
|
||||
target := DomainData{Domain: "a.com", Date: "2000-01-01", Registrar: "Same Inc.", Issuer: "Let's Encrypt", Class: "DV", SANs: "a.com", AgeDays: 9000, AgeKnown: true}
|
||||
suspect := DomainData{Domain: "b.com", Date: "2026-09-01", Registrar: "Same Inc.", Issuer: "Let's Encrypt", Class: "DV", SANs: "b.com", AgeDays: 8, AgeKnown: true}
|
||||
r := Score(target, suspect)
|
||||
if r.Score != 40 {
|
||||
t.Errorf("Score = %d, want 40 (isolated critical)", r.Score)
|
||||
}
|
||||
if got := Verdict(r.Score); got != "SUSPICIOUS — MANUAL REVIEW RECOMMENDED" {
|
||||
t.Errorf("Verdict = %q", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestScoreSameClassIssuerDiffNoPoints(t *testing.T) {
|
||||
target := DomainData{Domain: "a.com", Date: "2000-01-01", Registrar: "Same Inc.", Issuer: "Let's Encrypt", Class: "DV", AgeDays: 9000, AgeKnown: true}
|
||||
suspect := DomainData{Domain: "b.com", Date: "2000-01-01", Registrar: "Same Inc.", Issuer: "ZeroSSL", Class: "DV", AgeDays: 8000, AgeKnown: true}
|
||||
|
|
@ -44,6 +126,87 @@ func TestScoreSameClassIssuerDiffNoPoints(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestScoreTamperedSuspect(t *testing.T) {
|
||||
target := DomainData{Domain: "a.com", Date: "2000-01-01", Registrar: "Same Inc.", Issuer: "CA", Class: "DV", SANs: "a.com", AgeDays: 9000, AgeKnown: true}
|
||||
suspect := DomainData{Domain: "b.com", Date: "2000-01-01", Registrar: "Same Inc.", Issuer: "CA", Class: "DV", SANs: "b.com", AgeDays: 8000, AgeKnown: true,
|
||||
DNSTampered: true, DNSDetail: "resolution split on b.com: 1.1.1.1 report NXDOMAIN while system resolve live"}
|
||||
r := Score(target, suspect)
|
||||
if r.Score != 50 {
|
||||
t.Errorf("Score = %d, want 50 (isolated tampering)", r.Score)
|
||||
}
|
||||
if got := Verdict(r.Score); got != "SUSPICIOUS — MANUAL REVIEW RECOMMENDED" {
|
||||
t.Errorf("Verdict = %q", got)
|
||||
}
|
||||
found := false
|
||||
for _, f := range r.Findings {
|
||||
if strings.Contains(f, "TAMPERING") {
|
||||
found = true
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
t.Errorf("expected TAMPERING finding, got %v", r.Findings)
|
||||
}
|
||||
}
|
||||
|
||||
func TestScoreTamperedSuspectStacked(t *testing.T) {
|
||||
target := DomainData{Domain: "a.com", Date: "2000-01-01", Registrar: "Registrar A", Issuer: "DigiCert Inc", Class: "EV", SANs: "a.com", AgeDays: 9000, AgeKnown: true}
|
||||
suspect := DomainData{Domain: "b.com", Date: "2026-09-01", Registrar: "Registrar B", Issuer: "Let's Encrypt", Class: "DV", SANs: "b.com", AgeDays: 8, AgeKnown: true,
|
||||
DNSTampered: true, DNSDetail: "NS delegation split on b.com"}
|
||||
r := Score(target, suspect)
|
||||
// Stacked critical 80 + downgrade 40 + registrar 30 + tampering 50.
|
||||
if r.Score != 200 {
|
||||
t.Errorf("Score = %d, want 200 (fully stacked)", r.Score)
|
||||
}
|
||||
if got := Verdict(r.Score); got != "LIKELY PHISHING / IMPERSONATION ATTEMPT" {
|
||||
t.Errorf("Verdict = %q", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestScoreTamperedTargetNoteOnly(t *testing.T) {
|
||||
target := DomainData{Domain: "a.com", Date: "2000-01-01", Registrar: "Same Inc.", Issuer: "CA", Class: "DV", SANs: "a.com", AgeDays: 9000, AgeKnown: true,
|
||||
DNSTampered: true, DNSDetail: "NS delegation split on a.com"}
|
||||
suspect := DomainData{Domain: "b.com", Date: "2000-01-01", Registrar: "Same Inc.", Issuer: "CA", Class: "DV", SANs: "b.com", AgeDays: 8000, AgeKnown: true}
|
||||
r := Score(target, suspect)
|
||||
if r.Score != 0 {
|
||||
t.Errorf("Score = %d, want 0 (target-side split is display-only)", r.Score)
|
||||
}
|
||||
if len(r.Findings) != 1 || !strings.Contains(r.Findings[0], "NOTE") {
|
||||
t.Errorf("expected single NOTE finding, got %v", r.Findings)
|
||||
}
|
||||
}
|
||||
|
||||
func TestScoreHorizonNoteOnly(t *testing.T) {
|
||||
target := DomainData{Domain: "a.com", Date: "2000-01-01", Registrar: "Same Inc.", Issuer: "CA", Class: "DV", SANs: "a.com", AgeDays: 9000, AgeKnown: true}
|
||||
suspect := DomainData{Domain: "b.com", Date: "2000-01-01", Registrar: "Same Inc.", Issuer: "CA", Class: "DV", SANs: "b.com", AgeDays: 8000, AgeKnown: true,
|
||||
DNSSplit: dns.SplitHorizon, DNSDetail: "split-horizon pattern on b.com"}
|
||||
r := Score(target, suspect)
|
||||
if r.Score != 0 {
|
||||
t.Errorf("Score = %d, want 0 (horizon never scores)", r.Score)
|
||||
}
|
||||
if len(r.Findings) != 1 || !strings.Contains(r.Findings[0], "split-horizon") {
|
||||
t.Errorf("expected single split-horizon NOTE, got %v", r.Findings)
|
||||
}
|
||||
}
|
||||
|
||||
func TestScoreIdenticalWithDNSFindings(t *testing.T) {
|
||||
a := DomainData{Domain: "same.com", Date: "2026-09-08", Registrar: "R", Issuer: "I", Class: "DV", SANs: "same.com", AgeDays: 1, AgeKnown: true,
|
||||
DNSTampered: true, DNSSplit: dns.SplitSuppression, DNSDetail: "suppression pattern on same.com"}
|
||||
r := Score(a, a)
|
||||
if r.Score != 0 {
|
||||
t.Errorf("Score = %d, want 0 (identical domains never score)", r.Score)
|
||||
}
|
||||
if got := Verdict(r.Score); got != "LIKELY LEGITIMATE" {
|
||||
t.Errorf("Verdict = %q", got)
|
||||
}
|
||||
if len(r.Findings) != 2 {
|
||||
t.Fatalf("expected INFO + single NOTE, got %v", r.Findings)
|
||||
}
|
||||
for _, f := range r.Findings {
|
||||
if strings.Contains(f, "TAMPERING") {
|
||||
t.Errorf("identical domains must not emit TAMPERING, got %q", f)
|
||||
}
|
||||
}
|
||||
}
|
||||
func TestVerifyDataQuality(t *testing.T) {
|
||||
ok := DomainData{Domain: "a.com", Date: "2000-01-01", Registrar: "R", Issuer: "I", Class: "DV", AgeKnown: true}
|
||||
if err := VerifyDataQuality(ok, ok); err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue