Documentation
¶
Overview ¶
Package enrollauth is the node's admission policy module: the seam gating a joiner node's first issuance, a joiner host's login, and the founder's sensitive vote on a core's TRC submission — with its implementations filed one package each beneath this root: the CIDR authorizer admitting nodes by addressing and no host at all, the Telegram one admitting nodes one by one from an operator's phone, and the portal one pending every new node for the operator's passkey console to decide through the Operator surface — and a shared contract suite in impl/authtest every implementation runs. A host is admitted on an auth key alone, one the Telegram or the portal method minted, which names the node the host lands on. The --trust.enroll-auth run argument selects exactly one method, the caller importing the implementation it names; unset is open enrollment, the zero-conf default, while every registration and the founder's vote are denied.
Kind: policy — who is admitted, joiner node or host, and what the founder votes on; selected by the operator's --trust.enroll-auth spec, exactly one method.
Index ¶
Constants ¶
const ( MinKeyDays = 1 MaxKeyDays = 90 )
An auth key's lifetime bounds, in days after its minting.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdmissionAnswer ¶
type AdmissionAnswer struct {
// Admission is the verdict.
Admission AdmissionVerdict
// Note carries the plugin's own account of its decision; the registry
// records it with the entry.
Note string
// Node is the node a registration's host lands on: its address from
// that node's slice, and every session it opens through that node. The
// zero IA names the founding core; the other boundaries ignore it.
Node addr.IA
}
AdmissionAnswer is the verdict beside a note of the plugin's own words — what the registry records with the entry, the audit the operator reads beside the keys and addresses — and, for a registration, the node the host lands on.
type AdmissionAuthorizer ¶
type AdmissionAuthorizer interface {
// Authorize answers one admission exchange.
Authorize(context.Context, AdmissionFacts) AdmissionAnswer
}
AdmissionAuthorizer is the seam the boundaries ask: the caller invokes it exactly when the mechanical checks pass and nothing yet stands for the joiner — possession verified, the name free at enrollment, the key unseen at registration, a classifying update short of the founder's vote at the voting submission — and admits, refuses, or pends on its answer. The callers — the control plane's trust service, its TRC decision, the coordination application — import this root to pose the question; the implementations beneath it import the same root to answer it, and neither caller knows a type of them.
type AdmissionFacts ¶
type AdmissionFacts struct {
// Boundary is the boundary asking.
Boundary Boundary
// Keys holds fingerprints of the keys the exchange presented — the CSR's
// subject key at enrollment, whose possession the CMS wrapper proved; the
// machine and node keys at registration, the first authenticated by the
// noise channel and the second offered for the data plane; the keys of
// the certificates the submitted successor adds at the voting
// submission, in the successor's order.
Keys []string
// Source is the return-routable source: the SCION underlay address at
// enrollment, the internet address the completed TLS connection names at
// registration, the peer channel's SCION underlay address at the voting
// submission. The zero AddrPort when the context carries none, itself a
// fact an implementation may fail closed on.
Source netip.AddrPort
// Credential is what the joiner carried: the registration's auth key,
// empty at an enrollment exchange that carries none and at a bare
// registration alike.
Credential string
// Claim is the ISD-AS the exchange is about: the enrollment's
// self-assertion, the voting submission's channel-verified presenter;
// zero at registration.
Claim addr.IA
}
AdmissionFacts are the verified facts of one admission exchange: the boundary asking, fingerprints of the keys the exchange presented, the return-routable source, the credential the joiner carried, and the exchange's claim — all of it in the clear, handed to the plugin, nothing else decided on. The source is bound by the completed handshake at every boundary, yet it remains the joiner's own claim otherwise: a node behind a NAT presents its private address, a host behind it the NAT's external one, so a private-range entry is what admits such joiners.
type AdmissionVerdict ¶
type AdmissionVerdict int
AdmissionVerdict is an authorizer's decision. Deny is the zero value: an uninitialized verdict must not admit. Pending is not an error state but a first-class verdict the joiner's own retry loop consumes without change — the request returns as undecided and the next retry asks again.
const ( // AdmissionDeny refuses the exchange. AdmissionDeny AdmissionVerdict = iota // AdmissionAllow admits it. AdmissionAllow // AdmissionPending holds the decision for an operator to make. AdmissionPending )
type Ask ¶ added in v0.0.7
type Ask struct {
// ID names the ask to Decide.
ID string
// Boundary, Claim, Keys, and Source are the latest facts the identity
// presented.
Boundary Boundary
Claim addr.IA
Keys []string
Source netip.AddrPort
// FirstSeen, LastSeen, and Attempts count the identity's asking.
FirstSeen time.Time
LastSeen time.Time
Attempts int
// Verdict is the standing decision, AdmissionPending while undecided;
// Until is when a decision lapses, zero while it pends.
Verdict AdmissionVerdict
Until time.Time
}
Ask is one identity's request as the operator reads it: the latest facts it presented, how often and since when it asked, and the standing decision.
type AuthKey ¶ added in v0.0.7
type AuthKey struct {
ID string
Description string
Reusable bool
Created time.Time
Expires time.Time
Uses int
State KeyState
Node addr.IA
}
AuthKey is one minted key as the operator reads it, never the key itself: Node is the node its hosts land on, the zero IA naming the founding core.
type Boundary ¶
type Boundary int
Boundary names the boundary asking one admission question: enrollment at a joiner node's first issuance, registration at a joiner host's login, the voting submission at a core's TRC submission that needs the founder's sensitive vote. The same plugin answers all three, distinguished only by the context it is handed.
type KeyRequest ¶ added in v0.0.7
KeyRequest is what the operator asks of a new auth key: its description, whether it admits more than one host, its lifetime, between MinKeyDays and MaxKeyDays, and the node its hosts land on — the zero IA naming the founding core.
type Operator ¶ added in v0.0.7
type Operator interface {
// Asks lists the standing asks at the boundaries, oldest first: the
// pending, the approved whose joiner has not yet returned, and the
// rejected.
Asks(boundaries ...Boundary) []Ask
// Decide records the operator's decision on the ask the ID names,
// reporting whether one stood to decide.
Decide(id string, approve bool) bool
// MintKey mints an auth key and answers the key itself — the one time
// it leaves the method — beside its record.
MintKey(req KeyRequest) (string, AuthKey, error)
// Keys lists the minted keys, newest first.
Keys() []AuthKey
// RevokeKey retires the key the ID names, reporting whether it named
// one.
RevokeKey(id string) (bool, error)
}
Operator is the surface an operator's console decides through: the asks a method holds pending — node enrollments and the founder's votes — the decisions on them, and the auth keys the method mints and retires, each the whole admission of a host. A method that pends for an operator implements it beside AdmissionAuthorizer, and its console reaches it through the authorizer the operator selected — never through the implementation.
Directories
¶
| Path | Synopsis |
|---|---|
|
impl
|
|
|
authtest
Package authtest implements the shared contract tests for enrollment authorizer implementations, the databases' impl/dbtest pattern: an implementation has at least one test that runs this suite.
|
Package authtest implements the shared contract tests for enrollment authorizer implementations, the databases' impl/dbtest pattern: an implementation has at least one test that runs this suite. |
|
portal
Package portal is the admission method the operator's passkey console decides: a node's enrollment and a core's vote pend until the operator approves or rejects them, and a host is admitted on an auth key the method minted alone, onto the node the key names.
|
Package portal is the admission method the operator's passkey console decides: a node's enrollment and a core's vote pend until the operator approves or rejects them, and a host is admitted on an auth key the method minted alone, onto the node the key names. |