Documentation
¶
Overview ¶
Package eval turns an observed TLS scan report into judgements: findings with severities, a post-quantum readiness level, and a TLS hygiene score.
Everything here is a pure function of the report (and the time, for certificate expiry). Every finding carries citations and an evidence tier, and a test fails any rule without a citation: the product states nothing it cannot source. The readiness scale and the hygiene score are this product's own; the facts they rest on are cited, the scales themselves are not presented as standards.
Index ¶
- Constants
- Variables
- func BandFor(score int) string
- func BandName(band string) string
- func BandRank(band string) int
- func CertificateRuleIDs() []string
- func LevelLabel(l int) string
- func PassText(id string) string
- func RuleIDs() []string
- func SSHBaselineSummary(ev Evaluation) (id string, meets *bool, changes int)
- func SSHRuleIDs() []string
- func StandardsSummary(ev Evaluation) map[string]string
- type AlgorithmUse
- type AttackView
- type BaselineChange
- type BaselineEntry
- type BaselineRequirement
- type Ceiling
- type CertificateFacts
- type ChainView
- type Change
- type Check
- type Citation
- type ClientProfile
- type ClientSim
- type ClientSummary
- type Conformance
- type DHGroupView
- type Deduction
- type Diff
- type Dimension
- type Evaluation
- type Evidence
- type Finding
- type Hygiene
- type Impact
- type Input
- type KeyStrength
- type LifetimeView
- type MissingView
- type NamesView
- type OCSPView
- type PriorityInput
- type PriorityMeta
- type Ranked
- type Readiness
- type Reason
- type RefInfo
- type RequireView
- type Requirement
- type RequirementResult
- type Rule
- type SCTView
- type SSHAlgorithm
- type SSHBaseline
- type Section
- type ServedView
- type ServiceFacts
- type Severity
- type Standard
- type StandardResult
- type StrengthPart
- type SuiteStrength
- type Verdict
Constants ¶
const ( LevelUndetermined = -1 // the scan could not establish TLS 1.3 support LevelNotReady = 0 // no TLS 1.3, so no post-quantum key exchange is possible LevelExposed = 1 // TLS 1.3 but only classical key exchange LevelHybridAvail = 2 // a standardised hybrid group is supported, not negotiated by a current client LevelHybridNeg = 3 // a current client negotiates a standardised hybrid group LevelPQAuth = 4 // level 3 plus post-quantum authentication (presented, or accepted by the signature stage) )
Readiness levels. This scale is the product's own (PRD-001 section 7); the facts each level rests on are cited, the scale is not a standard.
const ( SecCertificates = "certificates" SecRevocation = "revocation" SecProtocols = "protocols" SecSuites = "suites" SecKeyExchange = "key-exchange" SecFeatures = "features" SecHTTP = "http" SecVulnerabilities = "vulnerabilities" )
Section identifiers, in page order (PRD-004 REQ-TUI-4, REQ-TUI-8).
const ( StatusProblem = "problem" StatusAttention = "attention" StatusGood = "good" StatusNotChecked = "not-checked" StatusNotCollected = "not-collected" // StatusNotApplicable: the area does not exist for this service (no HTTP layer behind an SMTP // or LDAP endpoint), so there was nothing to check; it is not a gap in the scan. StatusNotApplicable = "not-applicable" StatusInconclusive = "inconclusive" // StatusUnknown: every check in the area ran, but the property the area is about cannot be // known from the endpoint alone (revocation, without contacting the CA). Its checks still count. StatusUnknown = "unknown" )
Section statuses: a word, never only a colour.
const ( SecSSHVersion = "ssh-version" SecHostKeys = "host-keys" SecEncryption = "encryption" SecIntegrity = "integrity" )
SSH section identifiers, in page order.
const ( ReqPQKex = "pq-kex" ReqStrictKex = "strict-kex" ReqRSASize = "rsa-size" )
Requirement ids with their own checks.
const ( BaselineAllowed = "allowed" BaselineOff = "off" )
Baseline verdicts of one algorithm (SSHAlgorithm.Baseline).
const ( ChangeRemove = "remove" ChangeAdd = "add" ChangeUpgrade = "upgrade" ChangeReplaceKey = "replace-key" )
Change actions.
const ( ReqMet = "met" ReqNotMet = "not-met" ReqNotAssessed = "not-assessed" // the scan holds no evidence either way ReqNotApplicable = "not-applicable" // there is nothing to judge (no CBC suites for a CBC rule) )
Requirement statuses.
const ( StdMeets = "meets" StdFails = "does-not-meet" StdNotAssessed = "not-assessed" )
Standard verdicts.
const ( LevelMust = "must" LevelShould = "should" )
Requirement levels. A "must" is the document's shall / MUST / "not recommended" for a thing the document forbids; a "should" is a recommendation. A standard is met when no must fails.
const ( StrengthStrong = "strong" StrengthAcceptable = "acceptable" StrengthWeak = "weak" StrengthInsecure = "insecure" )
The suite strength words (PRD-010 §2).
const BandNotRated = "Not rated"
BandNotRated is the band of a result that could not be rated.
const BaselineDefault = "cipherhorizon-ssh-2026"
BaselineDefault is the baseline an SSH evaluation uses unless told otherwise.
const PriorityVersion = "priority/1"
PriorityVersion identifies the rule set, recorded with every ranking.
const ProtocolSSH = "ssh"
ProtocolSSH is Evaluation.Protocol for an SSH endpoint (empty means TLS).
const Version = "eval/17"
Version identifies the rule set that produced an Evaluation. Stored evaluations keep the version they were made with, so history shows what was concluded then.
Variables ¶
var SSHSectionOrder = []string{SecSSHVersion, SecKeyExchange, SecHostKeys, SecEncryption, SecIntegrity, SecVulnerabilities}
SSHSectionOrder is the order an SSH report's sections appear in.
var SectionOrder = []string{SecCertificates, SecRevocation, SecProtocols, SecSuites, SecKeyExchange, SecFeatures, SecHTTP, SecVulnerabilities}
SectionOrder is the order sections appear in.
Functions ¶
func BandName ¶ added in v0.4.0
BandName is a band's current name: an evaluation stored before PRD-011 says the old one.
func BandRank ¶
BandRank orders bands from worst (0) to best; Not rated is below Failing. An old name ranks as its new one.
func CertificateRuleIDs ¶
func CertificateRuleIDs() []string
CertificateRuleIDs lists the rule IDs EvaluateCertificate can produce.
func RuleIDs ¶
func RuleIDs() []string
RuleIDs lists the IDs of the built-in rules (PQC readiness findings, which come from the readiness assessment, are not included).
func SSHBaselineSummary ¶
func SSHBaselineSummary(ev Evaluation) (id string, meets *bool, changes int)
SSHBaselineSummary is the stored, listable part of a conformance (REQ-SHB-5).
func SSHRuleIDs ¶
func SSHRuleIDs() []string
SSHRuleIDs lists the SSH rules (for tests and the methodology page).
func StandardsSummary ¶ added in v0.5.0
func StandardsSummary(ev Evaluation) map[string]string
StandardsSummary is the compact form stored with a scan for lists and filters: standard id to verdict.
Types ¶
type AlgorithmUse ¶ added in v0.4.0
type AlgorithmUse struct {
Name string `json:"name"`
Class string `json:"class"` // asymmetric | symmetric | hash
Role string `json:"role"` // key exchange, signature, cipher, MAC, hash (HKDF), hash (PRF), hash (signature)
Strength algo.Strength `json:"strength"`
// PQC is the catalogue's post-quantum status, quantum-vulnerable or quantum-safe, or empty
// when the catalogue gives none (a hash's question is not a quantum one).
PQC string `json:"pqc,omitempty"`
// Versions are the protocol versions it is used in; UsedBy names the suites, or the
// certificates, that use it.
Versions []string `json:"versions,omitempty"`
UsedBy []string `json:"usedBy"`
// Weakest marks the weakest algorithm of its class (a broken one first, then the fewest bits).
Weakest bool `json:"weakest,omitempty"`
}
AlgorithmUse is one algorithm in one role on an endpoint.
type AttackView ¶
type AttackView struct {
Name string `json:"name"`
Status string `json:"status"` // exposed | not-exposed | not-tested
Findings []string `json:"findings,omitempty"`
Why string `json:"why"` // the result for this endpoint, in a sentence
Needs string `json:"needs,omitempty"` // the condition the attack requires
}
AttackView is one named attack in the vulnerabilities section.
type BaselineChange ¶
type BaselineChange struct {
Kind string `json:"kind,omitempty"`
Name string `json:"name,omitempty"`
Action string `json:"action"` // remove | add | upgrade | replace-key
Text string `json:"text"`
Cite Citation `json:"cite"`
}
BaselineChange is one thing to do to meet the baseline.
type BaselineEntry ¶
type BaselineEntry struct {
Name string `json:"name"`
Since string `json:"since"`
Cite Citation `json:"cite"`
}
BaselineEntry is one allowed name, why it is allowed, and the OpenSSH version that first offers it ("—" when OpenSSH does not implement it).
type BaselineRequirement ¶
type BaselineRequirement struct {
ID string `json:"id"`
Text string `json:"text"`
Cite Citation `json:"cite"`
Kind string `json:"kind,omitempty"` // the registry kind AnyOf is about
AnyOf []string `json:"anyOf,omitempty"` // at least one offered; empty for the special checks
Since string `json:"since,omitempty"` // OpenSSH version that brings it, for the fix text
}
BaselineRequirement is something a server must do, beyond offering only allowed names.
type CertificateFacts ¶
type CertificateFacts struct {
Subject string
NotBefore time.Time
NotAfter time.Time
KeyAlgorithm string // RSA, ECDSA, Ed25519, ... as certinfo names it
KeyBits int // 0 when unknown
SigName string // the signature algorithm's name, e.g. SHA256-RSA
IsCA bool
SelfSigned bool
// SHA256 and SPKISHA256 identify the certificate and its key (lower-case hex; either may be
// empty), for the distrust list.
SHA256 string
SPKISHA256 string
}
CertificateFacts is what a certificate says about itself: enough to judge it, wherever it was found (presented by a server, held in a store, described in an imported CBOM). It carries no key material and no path.
type ChainView ¶
type ChainView struct {
Source string `json:"source"`
NoSNI bool `json:"noSni,omitempty"`
Leaf string `json:"leaf"` // SHA-256
Served ServedView `json:"served"`
Trust []pki.StoreResult `json:"trust"`
Private *pki.StoreResult `json:"private,omitempty"`
OS *pki.StoreResult `json:"os,omitempty"`
Public bool `json:"public"` // trusted, or distrusted only by a constraint, by a bundled store
Names NamesView `json:"names"`
Lifetime LifetimeView `json:"lifetime"`
OCSP *OCSPView `json:"ocsp,omitempty"`
SCTs []SCTView `json:"scts"`
// Revocation sources the leaf names. CRLs are contacted only when the scan's CRL
// lookups were on (CRLLookups); OCSP responders never are.
OCSPURLs []string `json:"ocspUrls,omitempty"`
CRLURLs []string `json:"crlUrls,omitempty"`
// CRL is what the CRL lookups found for each certificate on the served path.
CRL []pki.CRLResult `json:"crl,omitempty"`
CRLLookups bool `json:"crlLookups,omitempty"`
Error string `json:"error,omitempty"` // the chain could not be analysed
}
ChainView is the evaluation's reading of one served chain: how it was served, who trusts it, which names it covers, its lifetime against the limit, its stapled OCSP response and its SCTs.
type Change ¶
type Change struct {
Area string `json:"area"` // readiness | hygiene | protocol | suite | group | certificate | finding
Kind string `json:"kind"` // added | removed | changed
Subject string `json:"subject"`
Before string `json:"before,omitempty"`
After string `json:"after,omitempty"`
Impact Impact `json:"impact"`
}
Change is one difference between two scans of the same endpoint.
type Check ¶
type Check struct {
ID string `json:"id"`
Title string `json:"title"`
Section string `json:"section"`
Severity Severity `json:"severity"`
Result string `json:"result"`
// Pass says what was confirmed when the check found nothing.
Pass string `json:"pass,omitempty"`
}
Check is one check the evaluation ran. Title names what was looked for (a problem, as a finding would be titled); Result is found, not-found, not-checked (its stage did not run) or not-applicable (the area does not exist for this service).
type ClientProfile ¶ added in v0.5.0
type ClientProfile struct {
ID string `json:"id"`
Name string `json:"name"`
Family string `json:"family"` // browser | mobile | runtime | library | legacy
Released string `json:"released"`
Source string `json:"source"`
Note string `json:"note,omitempty"`
// Versions the client offers, highest first; suites per version class (TLS 1.3 names and
// TLS 1.2-and-earlier names, each in the client's preference order); groups in preference
// order, with the first KeyShares groups carrying a key share in the first flight.
Versions []string `json:"versions"`
Suites13 []string `json:"suites13,omitempty"`
Suites12 []string `json:"suites12"`
Groups []string `json:"groups"`
// SigAlgs are the TLS 1.3 signature schemes offered (by family: "ecdsa", "rsa_pss", "rsa_pkcs1",
// "ed25519", "mldsa"), used to decide which certificate the client can authenticate.
SigAlgs []string `json:"sigAlgs"`
// MaxDHBits caps the finite-field DH prime the client accepts; 0 means no cap.
MaxDHBits int `json:"maxDhBits,omitempty"`
// MinRSABits is the smallest RSA certificate key the client accepts.
MinRSABits int `json:"minRsaBits,omitempty"`
// RejectsSHA1 says the client refuses a certificate signed with SHA-1.
RejectsSHA1 bool `json:"rejectsSha1"`
// NoSNI says the client sends no server_name: it gets the server's default certificate.
NoSNI bool `json:"noSni,omitempty"`
}
ClientProfile is what one client offers in its ClientHello.
func ClientByID ¶ added in v0.5.0
func ClientByID(id string) (ClientProfile, bool)
ClientByID finds a profile.
func Clients ¶ added in v0.5.0
func Clients() []ClientProfile
Clients lists the client profiles in display order.
type ClientSim ¶ added in v0.5.0
type ClientSim struct {
ID string `json:"id"`
Name string `json:"name"`
Family string `json:"family"`
Released string `json:"released"`
Connects bool `json:"connects"`
// Why says why the handshake fails, in words.
Why string `json:"why,omitempty"`
// What was negotiated.
Version string `json:"version,omitempty"`
Suite string `json:"suite,omitempty"`
Group string `json:"group,omitempty"`
ForwardSecrecy bool `json:"forwardSecrecy"`
PQ bool `json:"pq"`
// HelloRetry: TLS 1.3 needed a second flight because no key share matched.
HelloRetry bool `json:"helloRetry,omitempty"`
// DefaultCertificate: the client sends no SNI and gets the server's default certificate,
// which may not be the one a named client gets.
DefaultCertificate bool `json:"defaultCertificate,omitempty"`
// Decided says who chose the suite: "server" or "client".
Decided string `json:"decided,omitempty"`
Note string `json:"note,omitempty"`
}
ClientSim is the simulated outcome for one client.
type ClientSummary ¶ added in v0.5.0
type ClientSummary struct {
Connect int `json:"connect"`
Fail int `json:"fail"`
PQ int `json:"pq"`
NoFS int `json:"noFs"`
}
ClientSummary is the fleet-friendly tally stored beside a scan.
func SummariseClients ¶ added in v0.5.0
func SummariseClients(sims []ClientSim) *ClientSummary
SummariseClients tallies the simulated outcomes.
type Conformance ¶
type Conformance struct {
Baseline string `json:"baseline"`
Title string `json:"title"`
// Judged is false when the server's lists were not read; Meets then means nothing.
Judged bool `json:"judged"`
Reason string `json:"reason,omitempty"`
Meets bool `json:"meets"`
Changes []BaselineChange `json:"changes"`
Requires []RequireView `json:"requires"`
SSHDConfig string `json:"sshdConfig"`
}
Conformance is how one SSH server measures against one baseline.
type DHGroupView ¶
type DHGroupView struct {
Name string `json:"name"`
Source string `json:"source"`
Bits int `json:"bits"`
Negotiated bool `json:"rfc7919"`
}
DHGroupView is a published Diffie-Hellman group the server's prime matched.
type Deduction ¶
type Deduction struct {
Finding string `json:"finding"` // rule ID, e.g. CIPHER.RC4
Title string `json:"title"`
Severity Severity `json:"severity"`
Points int `json:"points"`
}
Deduction is one finding's effect on the score.
type Diff ¶
type Diff struct {
Changes []Change `json:"changes"`
Better int `json:"better"`
Worse int `json:"worse"`
Neutral int `json:"neutral"`
Summary string `json:"summary"`
}
Diff is the set of differences between two scans.
func Compare ¶
func Compare(fromRep, toRep *tlsprobe.Report, fromEv, toEv Evaluation) Diff
Compare reports what changed from one scan to a later one.
func CompareSSH ¶
func CompareSSH(from, to *sshprobe.Report, fromEv, toEv Evaluation) Diff
CompareSSH reports what changed from one SSH scan to a later one (PRD-008 REQ-SHE-7).
type Dimension ¶
type Dimension struct {
Status string `json:"status"`
Detail string `json:"detail"`
Evidence Evidence `json:"evidence"`
Citations []Citation `json:"citations"`
}
Dimension is one facet of readiness.
type Evaluation ¶
type Evaluation struct {
Version string `json:"version"`
// Protocol is "ssh" for an SSH endpoint and empty for TLS, so stored TLS evaluations are unchanged.
Protocol string `json:"protocol,omitempty"`
Findings []Finding `json:"findings"`
Readiness Readiness `json:"readiness"`
Hygiene Hygiene `json:"hygiene"`
Counts map[Severity]int `json:"counts"`
// eval/3 additions.
EvaluatedAt time.Time `json:"evaluatedAt"`
Sections []Section `json:"sections"`
FixFirst []string `json:"fixFirst"` // rule IDs, at most three
PKI []ChainView `json:"pki"`
Vulnerabilities []AttackView `json:"vulnerabilities"`
ReferenceData []RefInfo `json:"referenceData"`
// DHGroup names the server's DHE prime when it is a published group.
DHGroup *DHGroupView `json:"dhGroup,omitempty"`
// Checks is every check this evaluation considered, with its result (PRD-006 REQ-EV-1).
Checks []Check `json:"checks"`
// LegacyReport is set when the report predates tls-report/2: the sections
// that need its data are marked not-collected.
LegacyReport bool `json:"legacyReport,omitempty"`
// SSHAlgorithms is, for an SSH endpoint, every advertised algorithm with its verdict.
SSHAlgorithms []SSHAlgorithm `json:"sshAlgorithms,omitempty"`
// Baseline is, for an SSH endpoint, how it measures against an SSH baseline (PRD-008 WP-G).
// SSH servers are judged this way and get no hygiene score (REQ-SHE-5).
Baseline *Conformance `json:"baseline,omitempty"`
// eval/9 (PRD-010): the classical strength of every accepted suite (rated by its weakest part)
// and of every accepted group and presented certificate key.
SuiteStrength []SuiteStrength `json:"suiteStrength,omitempty"`
KeyStrength []KeyStrength `json:"keyStrength,omitempty"`
// eval/10 (PRD-011): every algorithm the endpoint uses, by class, with its strength,
// post-quantum status and uses. Each suite part also says its class, and gains its hash part.
Algorithms []AlgorithmUse `json:"algorithms,omitempty"`
// eval/14 (PRD-017): how the endpoint measures against each published standard this program
// carries (NIST SP 800-52, BSI TR-02102, BCP 195, ...), clause by clause.
Standards []StandardResult `json:"standards,omitempty"`
// eval/15 (PRD-018): what each named client would negotiate with this server, computed from the
// enumerated versions, suites and groups and the client's published defaults; nothing is sent.
Clients []ClientSim `json:"clients,omitempty"`
}
Evaluation is the full judgement of one scan.
func Evaluate ¶
func Evaluate(rep *tlsprobe.Report, now time.Time) Evaluation
Evaluate judges a scan report at now, against the bundled root stores and no private anchors.
func EvaluateSSH ¶
func EvaluateSSH(rep *sshprobe.Report, in Input) Evaluation
EvaluateSSH judges an SSH scan report.
func EvaluateWith ¶
func EvaluateWith(rep *tlsprobe.Report, in Input) Evaluation
EvaluateWith judges a scan report with explicit inputs.
type Evidence ¶
type Evidence string
Evidence says how a statement is known.
const ( // Observed: a server reply demonstrated it. Observed Evidence = "observed" // Inferred: a consequence of what was observed (e.g. POODLE from SSLv3 plus CBC // suites), not separately tested. Inferred Evidence = "inferred" // Registry: stated by an authoritative registry (e.g. IANA marks a suite Discouraged). Registry Evidence = "registry" // NotMeasured: something the product does not test, listed so its absence is not // mistaken for a clean result. NotMeasured Evidence = "not-measured" )
The evidence tiers.
type Finding ¶
type Finding struct {
ID string `json:"id"`
Title string `json:"title"`
Severity Severity `json:"severity"`
Category string `json:"category"` // protocol | cipher | key-exchange | certificate | feature | vulnerability | pqc
Detail string `json:"detail"` // what was seen on this endpoint
Evidence Evidence `json:"evidence"`
Citations []Citation `json:"citations"`
Remediation string `json:"remediation"`
// Section is the endpoint-page section the finding belongs to.
Section string `json:"section"`
// Labels name the published attacks this weakness enables (FREAK, Logjam,
// ...). They are labels on the finding, never separate findings.
Labels []string `json:"labels,omitempty"`
// Availability marks findings that make clients fail to connect.
Availability bool `json:"availability,omitempty"`
}
Finding is one judgement about an endpoint.
func EvaluateCertificate ¶
func EvaluateCertificate(f CertificateFacts, now time.Time) []Finding
EvaluateCertificate judges one certificate. It applies the same certificate rules as the TLS evaluation (expired, not yet valid, expiring soon, weak key, broken signature hash; TestCertificateRulesAgreeWithTheTLSRules keeps the two in step) plus one that only makes sense per certificate: a quantum-vulnerable key whose certificate outlives the dates NIST sets for retiring such keys. Every finding is cited. It never says a certificate is trusted or in use: that needs facts this function does not have.
type Hygiene ¶
type Hygiene struct {
Score int `json:"score"` // 0 to 100, or -1 when not rated
Band string `json:"band"`
Deductions []Deduction `json:"deductions"`
Ceiling *Ceiling `json:"ceiling"` // nil when no ceiling applied
NotMeasured []string `json:"notMeasured"`
Methodology string `json:"methodology"`
}
Hygiene is the rating of one result.
type Impact ¶
type Impact string
Impact says whether a change moved the endpoint's posture the right way.
type Input ¶
type Input struct {
Now time.Time
// Stores are the public root stores; nil means the bundled ones
// (refdata.Stores). A store-less evaluation is possible with an empty,
// non-nil slice.
Stores []*pki.Store
// Anchors are the operator's private CA certificates (server-wide bundle
// plus the system's own), as one unconstrained store; nil when none.
Anchors *pki.Store
// SSLv2Keys maps a public-key SHA-256 (SPKI) to the other endpoints in the
// estate whose latest scan accepted SSLv2 while serving that key.
SSLv2Keys map[string][]string
// SSHBaseline is the id of the baseline an SSH server is judged against; empty means
// BaselineDefault.
SSHBaseline string
// Distrust lists keys and certificates no path should rely on; nil means the bundled
// list (refdata.Distrust). A listed key is reported on the path it sits on, never used
// to stop evaluating it.
Distrust *pki.Distrust
}
Input is everything evaluation reads besides the report. The zero value (with Now set) evaluates against the bundled root stores and nothing else.
type KeyStrength ¶ added in v0.4.0
type KeyStrength struct {
Kind string `json:"kind"` // group | certificate-key
Version string `json:"version,omitempty"`
Name string `json:"name"`
Strength algo.Strength `json:"strength"`
}
KeyStrength is the strength of an accepted key-exchange group or a presented certificate key.
type LifetimeView ¶
type LifetimeView struct {
Days int `json:"days"`
LimitDays int `json:"limitDays,omitempty"`
LimitSource string `json:"limitSource,omitempty"`
Applies bool `json:"applies"` // only publicly trusted certificates are held to the limit
}
LifetimeView compares the validity period with the limit in force when the certificate was issued.
type MissingView ¶
type MissingView struct {
IssuerDN string `json:"issuer"`
AIA []string `json:"aia,omitempty"` // caIssuers URLs, not fetched
// Likely is "intermediate" when the served path stops at a certificate that
// names where its issuer can be downloaded (AIA caIssuers, as public CAs'
// leaves do): a server that forgot its intermediate. It is "root" when the
// path already ends at a CA certificate, or the leaf names no issuer URL (a
// leaf signed straight by a root): then the unknown issuer is most likely a
// root no store holds, which servers do not send anyway.
Likely string `json:"likely"`
}
MissingView describes the issuer the served path stops short of.
type NamesView ¶
type NamesView struct {
Host string `json:"host"`
Checked []string `json:"checked"` // the SANs, "DNS:x" / "IP:y"
MatchedBy string `json:"matchedBy,omitempty"`
Error string `json:"error,omitempty"`
}
NamesView says which names were checked against which SANs (RFC 9525).
type OCSPView ¶
type OCSPView struct {
Present bool `json:"present"`
Error string `json:"error,omitempty"` // unreadable or not usable
Response string `json:"response,omitempty"` // outer responseStatus
Status string `json:"status,omitempty"` // good | revoked | unknown
RevokedAt time.Time `json:"revokedAt,omitempty"`
Reason string `json:"reason,omitempty"`
ThisUpdate time.Time `json:"thisUpdate,omitempty"`
NextUpdate time.Time `json:"nextUpdate,omitempty"`
ProducedAt time.Time `json:"producedAt,omitempty"`
Responder string `json:"responder,omitempty"`
Signature string `json:"signature,omitempty"` // valid | invalid | unsupported | no-issuer
Delegated bool `json:"delegated,omitempty"`
ForThisCert bool `json:"forThisCert"`
}
OCSPView is the stapled OCSP response.
type PriorityInput ¶
type PriorityInput struct {
SystemID int64
Name string
Meta PriorityMeta
Services []ServiceFacts
Certs []CertificateFacts // current end-entity certificates
// EvidenceFirstParty says the system has at least one current source made by this product's
// own scanner or collector; false means everything known about it was imported.
EvidenceFirstParty bool
EvidenceSources int // current sources of any class
}
PriorityInput is everything ranking reads about one system.
type PriorityMeta ¶
type PriorityMeta struct {
Criticality string // low, moderate, high
Exposure string // internet, internal, restricted
DataLifetimeYears *int
}
PriorityMeta holds the facts a person provides about a system (any may be empty: "not provided").
type Ranked ¶
type Ranked struct {
Rank int `json:"rank"`
SystemID int64 `json:"systemId"`
Name string `json:"name"`
Tier string `json:"tier"` // the first rule that placed it, in words
Reasons []Reason `json:"reasons"`
// Missing lists the inputs a person has not provided that would change how it is ranked.
Missing []string `json:"missing"`
// EvidenceOnly is true when none of exposure, criticality and data lifetime was provided: the
// position rests on what was observed alone.
EvidenceOnly bool `json:"evidenceOnly"`
Basis string `json:"basis"`
// Evidence says how the system is known: "observed" (this product's own scan or collector),
// "imported" (only from imported documents) or "none" (no current source).
Evidence string `json:"evidence"`
}
Ranked is one row of the ranking.
func Prioritise ¶
func Prioritise(inputs []PriorityInput, now time.Time) []Ranked
Prioritise ranks systems. now fixes the calendar (data lifetimes are years from now).
type Readiness ¶
type Readiness struct {
Level int `json:"level"`
Label string `json:"label"`
Summary string `json:"summary"`
// HNDLExposed: traffic recorded today with a current client would be readable by a
// future quantum computer, because the key exchange negotiated is classical.
HNDLExposed bool `json:"hndlExposed"`
KeyEstablishment Dimension `json:"keyEstablishment"`
Authentication Dimension `json:"authentication"`
Symmetric Dimension `json:"symmetric"`
// PQGroups are the standardised post-quantum groups the server accepts;
// ObsoletePQGroups are pre-standard draft groups, which do not count.
PQGroups []string `json:"pqGroups"`
ObsoletePQGroups []string `json:"obsoletePqGroups"`
NextSteps []string `json:"nextSteps"`
Citations []Citation `json:"citations"`
}
Readiness is the post-quantum readiness of an endpoint.
type Reason ¶
type Reason struct {
Rule string `json:"rule"`
Text string `json:"text"`
Citations []Citation `json:"citations,omitempty"`
}
Reason is one fact that puts a system where it is, with its sources.
type RefInfo ¶
type RefInfo struct {
Name string `json:"name"`
Source string `json:"source"`
Retrieved string `json:"retrieved"`
Count int `json:"count"`
AgeDays int `json:"ageDays"`
Stale bool `json:"stale"`
// StaleAfterDays is the age at which this list counts as old (30 days for the trust lists).
StaleAfterDays int `json:"staleAfterDays"`
Licence string `json:"licence"`
}
RefInfo is one bundled reference list as the evaluation used it.
type RequireView ¶
type RequireView struct {
ID string `json:"id"`
Text string `json:"text"`
Met bool `json:"met"`
// NotApplicable: there was nothing to judge (no RSA host key for an RSA size rule). Met stays
// true, so the verdict is unchanged; the page says "does not apply" instead of "met".
NotApplicable bool `json:"notApplicable,omitempty"`
Detail string `json:"detail,omitempty"`
Cite Citation `json:"cite"`
}
RequireView is one requirement and whether the server meets it.
type Requirement ¶ added in v0.5.0
type Requirement struct {
ID string `json:"id"`
Clause string `json:"clause"`
Text string `json:"text"`
Level string `json:"level"`
// contains filtered or unexported fields
}
Requirement is one clause.
type RequirementResult ¶ added in v0.5.0
type RequirementResult struct {
ID string `json:"id"`
Clause string `json:"clause"`
Text string `json:"text"`
Level string `json:"level"`
Status string `json:"status"`
Detail string `json:"detail,omitempty"`
}
RequirementResult is one clause's result.
type Rule ¶
type Rule struct {
ID string `json:"id"`
Title string `json:"title"`
Text string `json:"text"`
Citations []Citation `json:"citations,omitempty"`
}
Rule describes one step of the ordering for the published methodology.
func PriorityMethodology ¶
func PriorityMethodology() []Rule
PriorityMethodology is the ordered rule list exactly as applied. A test keeps it in step with the rule identifiers Prioritise puts on its reasons.
type SCTView ¶
type SCTView struct {
Source string `json:"source"` // embedded | tls | ocsp
LogID string `json:"logId"` // base64
LogName string `json:"logName,omitempty"`
Operator string `json:"operator,omitempty"`
Timestamp time.Time `json:"timestamp"`
SigAlg string `json:"signatureAlgorithm,omitempty"`
}
SCTView is one SCT and where it came from.
type SSHAlgorithm ¶
type SSHAlgorithm struct {
Kind string `json:"kind"` // kex | host-key | cipher | mac | compression
Name string `json:"name"`
Display string `json:"display"`
// Verdict is post-quantum, fine, should-be-off or unknown (not in this program's registry).
Verdict string `json:"verdict"`
// Used: a current client (OpenSSH 10.6 defaults) uses it.
Used bool `json:"used,omitempty"`
// Baseline is allowed or off against the evaluation's baseline (PRD-008 REQ-SHB-3).
Baseline string `json:"baseline"`
// Strength is its classical strength (PRD-010 REQ-STR-7); nil for compression.
Strength *algo.Strength `json:"strength,omitempty"`
}
SSHAlgorithm is one advertised SSH algorithm with its verdict, so the report can show, for each name, what it is and whether that is right (UX-DESIGN-006 §2.4) without judging in the browser.
type SSHBaseline ¶
type SSHBaseline struct {
ID string `json:"id"`
Title string `json:"title"`
Version string `json:"version"`
// Allowed is, per registry kind, the allow-list in preference order (the order the generated
// sshd_config lines use). A name not on its kind's list should be off.
Allowed map[string][]BaselineEntry `json:"allowed"`
Requires []BaselineRequirement `json:"requires"`
MinRSABits int `json:"minRsaBits"`
}
SSHBaseline is one named, versioned baseline.
func SSHBaselineByID ¶
func SSHBaselineByID(id string) (*SSHBaseline, bool)
SSHBaselineByID finds a baseline.
func SSHBaselines ¶
func SSHBaselines() []*SSHBaseline
SSHBaselines lists the baselines this program carries.
type Section ¶
type Section struct {
ID string `json:"id"`
Status string `json:"status"`
// Reason explains a not-checked, not-collected or inconclusive status, or
// a limit of what a good section means.
Reason string `json:"reason,omitempty"`
ReasonCode string `json:"reasonCode,omitempty"`
Findings []string `json:"findings"` // rule IDs, in severity order
// Inconclusive lists the parts of the stage that proved nothing.
Inconclusive []string `json:"inconclusive,omitempty"`
}
Section is one part of the endpoint page with its status.
type ServedView ¶
type ServedView struct {
Order []string `json:"order"` // SHA-256 of each served certificate, in served order
Path []int `json:"path"` // served indexes on the path from the leaf up
Issues []pki.Issue `json:"issues,omitempty"`
SizeBytes int `json:"sizeBytes"`
// Missing names the issuer the server should have sent, when it did not.
Missing *MissingView `json:"missing,omitempty"`
// ExpiresFirst lists served-path positions that expire before the leaf.
ExpiresFirst []int `json:"expiresFirst,omitempty"`
}
ServedView is the chain as the server sent it.
type ServiceFacts ¶
type ServiceFacts struct {
Name string
HNDLExposed bool
ReadinessLevel *int
Critical, High int
HygieneCriticalOrHigh int
}
ServiceFacts is what the latest completed scan of one of the system's endpoints established.
type Severity ¶
type Severity string
Severity ranks a finding.
type Standard ¶ added in v0.5.0
type Standard struct {
ID string `json:"id"`
Title string `json:"title"`
Publisher string `json:"publisher"`
Edition string `json:"edition"`
Protocol string `json:"protocol"` // "tls" | "ssh"
URL string `json:"url"`
// Scope says, in one sentence, who the document binds and what it is for.
Scope string `json:"scope"`
// Requirements are the clauses this program judges.
Requirements []Requirement `json:"requirements"`
// NotAssessed names what the document requires that a network scan cannot see, so a
// "meets" is read for what it is.
NotAssessed []string `json:"notAssessed,omitempty"`
}
Standard is one published requirement set.
func StandardByID ¶ added in v0.5.0
StandardByID finds a standard.
func Standards ¶ added in v0.5.0
func Standards() []*Standard
Standards lists every standard this program carries, TLS first, in the order the pages show them.
func StandardsFor ¶ added in v0.5.0
StandardsFor lists the standards for a protocol ("tls" or "ssh").
type StandardResult ¶ added in v0.5.0
type StandardResult struct {
ID string `json:"id"`
Title string `json:"title"`
Publisher string `json:"publisher"`
Edition string `json:"edition"`
Protocol string `json:"protocol"`
URL string `json:"url"`
Scope string `json:"scope"`
// Verdict is meets, does-not-meet or not-assessed (nothing could be judged).
Verdict string `json:"verdict"`
// MustFailures and ShouldFailures count the clauses not met at each level.
MustFailures int `json:"mustFailures"`
ShouldFailures int `json:"shouldFailures"`
Met int `json:"met"`
NotAssessed int `json:"notAssessed"`
NotApplicable int `json:"notApplicable"`
Requirements []RequirementResult `json:"requirements"`
Limits []string `json:"limits,omitempty"`
}
StandardResult is how one scan measures against one standard.
type StrengthPart ¶ added in v0.4.0
type StrengthPart struct {
Role string `json:"role"` // cipher, key exchange, authentication, MAC, hash (HKDF), hash (PRF)
Class string `json:"class"` // asymmetric, symmetric or hash (PRD-011)
Name string `json:"name"` // AES-128-GCM, ffdhe2048, RSA-2048 certificate key, HMAC-SHA-1
Strength algo.Strength `json:"strength"`
}
StrengthPart is one part of a cipher suite and its strength.
type SuiteStrength ¶ added in v0.4.0
type SuiteStrength struct {
Version string `json:"version"`
ID uint16 `json:"id"`
Name string `json:"name"`
Word string `json:"word"`
Bits int `json:"bits,omitempty"`
Weakest string `json:"weakest,omitempty"`
Reason string `json:"reason"`
Parts []StrengthPart `json:"parts"`
}
SuiteStrength is a cipher suite's rating: the word, the bits of its weakest rated part, which part that is, and the reason for the word.