Home / Learn / 17 Information flow
Release v0.4.0Edition 0.2
17.10 Recap and reference
Page 11 of 11
17.10.1 For agents
una --json check . reports the U4xxx codes in the domain security. For the leak the checker stops:
json
{"schema":"una.diagnostics/1","diagnostics":[{"schema":"una.diagnostic/1","code":"U4003","severity":"error","domain":"security","message":"`@log.print` accepts `public` data, and this argument is `secret[PII]`","primary":{"file":"src/notices.una","start":{"line":78,"col":16},"end":{"line":78,"col":52}},"related":[],"repairs":[{"rank":1,"escape_cost":0,"description":"send `@log.print` only data labeled `public` or lower, or send this value to an operation that accepts `secret[PII]`","edit":null},{"rank":2,"escape_cost":1,"escape":{"kind":"trusted","cost":"the guarantee then rests on trusted code, whose labels are not checked: a policy releases the data, or a module joins the trusted base; it is listed in the build report and needs review"},"description":"declassify the value through a policy of a trusted module","edit":null}],"explain":"una explain U4003"}],"fixable":0}Neither repair has an edit, so una fix changes nothing: each needs a decision about the data. The first keeps the label. The second, a policy, has escape_cost 1 and an escape of kind trusted: it moves the guarantee onto trusted code. Prefer the repairs with escape_cost 0. The compact rule: a value flows only to a place labeled at or above it, branches label what they decide, fail needs a public program counter, and only a policy of a module trusted in its header and in una.toml lowers a label.
17.10.2 Recap
- A label is a level and categories:
public,internal,confidential,secret,restricted, and categories such as[PII]thatuna.tomldeclares. - A result carries the labels of what it was computed from, and of every condition or loop that chose it.
- Every operation argument is a sink.
Console.printacceptspublic, and your own operations accept whatacceptssays. - Data read from files or the environment is
internal. A keyed hash fromKeys.hmac, aHashed, keeps the label of what it hashed, and only==and!=read it. - Under a branch on labeled data, return a labeled value instead of failing or acting.
- Lower a label only through a
policywith a privateviafunction, in a module trusted in its header and inuna.toml. - Release the least you can, test each policy with examples, and read the release list in
una report ..
17.10.3 Reference
- Construct pages: labels,
policy, trusted modules, host capabilities,example - Configuration:
[labels] categories,[trusted] modules - Standard library: the prelude and the host capabilities
- Diagnostics: U1001, U2001, U3015, U4001, U4002, U4003, U4004, U4005, U4007, U7005
- Specification: information flow, including the guarantee and its scope (noninterference), labels, declassification policies (rule 3: inside
viafunctions labels are not checked, and they are part of the trusted computing base) and checking (rules 3 to 6), capabilities and effects, memory model (labels in loops and on editable names), standard library (the host capabilities and their labels), diagnostics and ABI - Security model: what is proven, trusted and outside the model
Next:18 Tools