Skip to main content

Module policy

Module policy 

Source
Expand description

What the browser may open. The streamed pane blocks local files and the browser’s own pages through the debugging channel (pane.rs, BLOCKED_URLS); in screen mode a person has the browser’s own address bar, so the block is the browser’s managed policy, which the browser reads before it starts. Screen mode does not start without it. This server only checks that the policy is there: the file is system-wide (every browser of that kind on the machine reads it), so whoever runs the machine or builds its image installs it.

Constants§

BLOCKED
Address patterns the browser never opens: local files, its own pages and tools, and an address a page could make from a string.
FILE_NAME 🔒

Functions§

any_browser 🔒
Whether any of these program names is a Chrome or Chromium (a process’s comm).
browser_running
Is a browser (Chrome or Chromium, or one of its helpers) running in this container right now?
ensure
The browser will start under the policy, or the words that say what is missing. The policy is the folder of the container (or dedicated machine) this server runs in, which holds this one browser: it is never written by the server, and screen mode serves no streamed browser next to it. first is true for the first screen session: no other browser may already be running in the container then.
holds
Does the policy in text hold every key wanted names: every address in BLOCKED blocked, the developer tools off, no extension may be installed, no sign-in to the browser itself, no file dialog, no download, and the network only through the address proxy?
listed 🔒
The strings in a policy key that holds a list (none when the key is absent or not a list).
missing_words 🔒
What to install, in words: the file, and what it holds.
policy_dir
The folder the browser reads managed policy from, by the kind of browser it is.
running_programs 🔒
The names of the programs running in this container (each process’s comm).
sandboxed_install
Is the browser a snap or a flatpak, or the shim that starts one? Such a browser reads its policy from inside its own sandbox, not from the folder checked here, so a file there would pass the check and be ignored by the browser.
wanted
The policy: the blocked addresses, no developer tools, no extensions, no sign-in to the browser itself, no file dialogs and no downloads (as in the streamed pane, which denies downloads), and the network the browser has: only the address proxy on proxy_port (every name is looked up by the proxy), no QUIC and no DNS over HTTPS. The browser is started with none of these as switches.