Home / Docs / Configure a package
Trust a dependency adds: trust
What it does
A trusted module may declare policies, which release labeled data, such as secret text, to a lower label. That is trust: the checker cannot prove a release safe, so a person reviews it. A dependency's trusted modules are trusted in a program only when the package consents to them by name, with a trust line, and the lock records that consent for the dependency's whole content. Any change of the dependency's files, its trusted modules or the code they call, needs the consent again.
ita shop
version 0.1.0
edition 0.4
needs
privacy from path "deps/privacy"
accept name
trust
privacy modules keyslock 1
solver
encoding "una-smt-1"
name "z3"
version "5.1.0"
logic "QF_UFLIA"
steps 5000000
seed 0
package privacy 1.0.0
from path "deps/privacy"
digest "sha256:3fe7550783d474c8fdee6cc550375b7d5906cda5d448f75a865524cce35e8526"
consented "sha256:3fe7550783d474c8fdee6cc550375b7d5906cda5d448f75a865524cce35e8526"
trusted modules keysita privacy
version 1.0.0
edition 0.4
trusted
keystrusted module keys
pub policy reveal
from secret Text
to Text
via shown
purpose "show a token"
owner team
shown(t: secret Text) -> Text = tmodule shop
import privacy.keys (reveal)
pub show(t: secret Text) -> Text = reveal(t)The release in privacy.keys is not a release into a boundary: its policy is declared in a module the package trusts.
Forms
trust
<name> [<major>] [from <source>] modules <module path>, ...
may <Capability>[<op>, ...]- The major line and the source may be left out for a package the package needs directly.
maylines write the ceiling of calls into the trusted modules. Until a crossing's ceiling depends on its direction, a dependency with trusted modules has one ceiling for all its modules, the intersection of the need'smaylines and the trust line's.
Examples
A trusted module that no trust line names, or whose consent the lock does not record for the dependency's content as it is now, is U7012 at the need. The refusal and the review print the flag to copy, with the content digest of the package as it is now. The repair is to review the trusted modules and the code they run, then:
$ una ita lock --accept-trust privacy@sha256:…
change privacy 1.0.0 (path deps/privacy): digest sha256:… -> sha256:…; may …; uses …
wrote ita.lockEdge cases
- Pinned to the whole package. A policy's
viamay call any function of its package, so the consent covers the content digest of every file of it, computed from the bytes checked. A consent to another digest is refused. - Only that module. A release whose policy is declared in a trusted module of a dependency is exempt from the boundary's rule; every other release still is not.
- The report lists each dependency's consented trusted modules under its
trust, and intcb.dependency_trustwith their line counts.
Diagnostics
- U7012: trust that no recorded consent covers.
Edition
Edition 0.4 and later, a preview.
Normative source
- spec/30 §13: trust a dependency adds.