Documentation
¶
Overview ¶
Package seal detects authama's state being moved or edited outside authama.
A seal is an HMAC-SHA256, keyed by a secret the OS keeps for the user (see services/owner), over each state file's name and content and over the binding: who the user is and which machine this is. authama reseals after each operation it performs, so when a file no longer matches its seal, something other than authama changed it; when the binding no longer matches, the home was copied to another account or machine.
This is detection, not prevention. Anyone who can run as the user can read and write the user's files, and can run authama to reseal them. What a seal adds is that a change made behind authama's back - by another program, a sync tool, a restored backup, or a person editing the file - is noticed and named the next time authama runs, instead of being acted on silently.
The package is pure: the caller reads the files and supplies the key.
Index ¶
Constants ¶
const Version = 1
Version is the seal record format.
Variables ¶
var ErrNoKey = errors.New("no sealing key")
ErrNoKey is a seal or verify asked for without a key.
Functions ¶
This section is empty.
Types ¶
type Binding ¶
type Binding struct {
User string // the OS user name
UID string // the numeric id, or the Windows SID
Machine string // the OS's machine id
}
Binding identifies the account and machine a home belongs to.
type Record ¶
type Record struct {
Version int `json:"version"`
Binding string `json:"binding"`
Sealed time.Time `json:"sealed"`
Files map[string]string `json:"files"` // name -> MAC; "" means the file was absent
MAC string `json:"mac"`
}
Record is what is stored: one MAC per sealed file, and one over the record.
type Report ¶
type Report struct {
// Authentic is false when the record itself fails its MAC: the seal file
// was edited, or the key is not the one that made it. Nothing else in the
// report can be trusted then, and Findings is empty.
Authentic bool
// Bound is false when the record was made for another account or machine.
Bound bool
Findings []Finding
}
Report is the outcome of a verification.