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] that una.toml declares.
  • 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.print accepts public, and your own operations accept what accepts says.
  • Data read from files or the environment is internal. A keyed hash from Keys.hmac, a Hashed, 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 policy with a private via function, in a module trusted in its header and in una.toml.
  • Release the least you can, test each policy with examples, and read the release list in una report ..

17.10.3 Reference

Next:18 Tools