Documentation
¶
Overview ¶
Package nativereceipt records file identities observed in a native process's Linux mappings. It does not prove in-memory code integrity or transient loads.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Process ¶
type Receipt ¶
type Receipt struct {
Process Process `json:"process"`
Stages []Stage `json:"stages"`
Files []File `json:"files"`
DriverObserved bool `json:"driver_observed"`
NVRTCObserved bool `json:"nvrtc_observed"`
BuiltinsObserved bool `json:"builtins_observed"`
Unobserved []string `json:"unobserved,omitempty"`
HashNanos int64 `json:"hash_nanos"`
Limit string `json:"limit"`
}
func Read ¶
Read decodes one bounded exclusive producer receipt. It does not infer child identity; the consumer must Check it against the process it actually started.
func (Receipt) Check ¶
Check binds a child receipt to its admitted executable/start/group identity, submitted source and actual compilation digest. Empty digests are refused.
func (Receipt) CheckDriver ¶
CheckDriver checks a precompiled-image receipt against the actual producer and submitted source/image bytes. Driver and executable mapping proofs are required; optional NVRTC and builtin claims must agree with all descriptors.
Example ¶
// A zero receipt cannot prove a producer or a prepared image.
var receipt Receipt
fmt.Println(receipt.CheckDriver(Process{}, "", ""))
Output: native receipt: producer process identity disagrees
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session retains descriptors until Close. New and Capture observe this process, never a controller's child. Hashing is deferred to Write and timed separately.
func (*Session) Capture ¶
Capture retains one bounded maps snapshot and its selected file descriptors. Empty digests are permitted before compilation; populated digests identify source and actual compiled artifact bytes at the consumer call site.
func (*Session) Write ¶
Write hashes retained descriptors and writes one exclusive receipt. Driver and NVRTC must actually have been observed; absent builtins remain unobserved. Hash time is reported; it must not be silently removed from process timing.
func (*Session) WriteDriver ¶
WriteDriver writes a precompiled-image receipt requiring an observed driver and executable. NVRTC and builtins are recorded only when actually observed. Their absence is explicit; this method does not load either library.
Example ¶
// A receipt requires a session created by New in the observed process.
var session *Session
fmt.Println(session.WriteDriver("/receipt.json"))
Output: native receipt: nil session