This page comes from docs/SECURITY-MODEL.md in the repository.
Pupitre can run playbooks as root on production hosts. Treat it as the most sensitive part of your system. This page tells what Pupitre protects, how, and what it does not protect. To report a vulnerability, read SECURITY.md. Part 7 of the specification has the full rules.
What Pupitre protects
| Asset | Where it is |
|---|---|
| The power to change the hosts | The run routes, the runner node and the SSH key |
| The SSH key of the runner | runner.ssh_key_file, on the runner node only |
| The secrets of the units | The store and the private folder of a run |
| The key of the store | storage.secret_key |
| The credential of Pupitre at the PDP | access.pdp.token |
| The values and their history | The store |
| The pinned host keys | runner.known_hosts_file |
Deployment rules
The operator MUST follow these rules. A deployment that breaks one of them is outside the security model.
- Only the edge or the proxy reaches the main listener. A network rule enforces it.
- Nothing outside the operator network reaches the ops listener.
- In the mode
open, a reverse proxy authenticates each person before the main listener. - The runner node is a dedicated machine or container. Only its operators have a shell on it.
runner.secrets_diris ontmpfs. The configuration file, the SSH key and the key of the store have the mode 0600 or 0400.- The playbooks, the roles and the schema files are in a Git repository with a review.
- The account of
serveon PostgreSQL has no right to change a table.
The controls
| Threat | Control |
|---|---|
| A person who reaches the page starts a deploy | A grant of run.apply for each environment, unit and host. In the mode open, run.apply is off by default. |
| A person who edits values makes a role run code | The values have closed schemas. No document names a program or a path. No text holds {{, {% or {#. The variable files tag each value of a document !unsafe, so Ansible never evaluates it as a template. |
| A person adds a command or a playbook | The commands, the playbooks and the schemas are in the configuration file only. |
| A secret leaks | No route gives a value. The private folder is on tmpfs, and Pupitre removes it after the run. The runner scrubs the output and the events. |
| An apply that nobody checked | An apply needs a check of the same snapshot hash, not older than runner.check_max_age, used one time. |
| Two applies in one environment at the same time | The lease of the environment |
| The runner node is taken | One runner node. The SSH key has the mode 0600. The host keys are pinned. No agent forwarding. |
| A log shows hidden control codes or HTML | The page shows logs as plain text, with a visible symbol for each control character. |
| A person learns that a unit exists | An unknown node and a forbidden node give the same 403. |
| A command parameter becomes a shell command | Closed types and ranges. A text parameter holds no template marker. The parameters go in a variable file with the tag !unsafe, never on the command line. |
| A person changes the address of a host to a machine of another environment | SSH finds the host key by <environment>.<host>, not by the address. The key of the other machine does not match. |
| Two people save one document | The etag and 409 conflict |
| A page of another site uses the browser of a person | The write guard and the strict policy of the page |
| A grant is revoked | Each write and each run asks the PDP with no kept answer. |
| The PDP is down | Pupitre fails closed with 503 pdp_unavailable. |
| A copy of the PostgreSQL database leaks | The secrets are encrypted with a key that is not in the database. |
The host check
An attacker can point a name that he owns to the main listener. The key server.allowed_hosts lists the values of Host that the listener serves. Another value gets 421 misdirected_request, for each method. With a loopback listener, the default is the loopback names. With any other address, the key is necessary.
The write guard
A page of another site must not use the browser of a person to change a document or to start a run. Each POST, PUT and DELETE passes this guard before Pupitre reads the body.
- A request with
Sec-Fetch-Siteneeds the valuesame-originornone. Else the answer is403 cross_site_request. - A request with
Originand noSec-Fetch-Siteneeds anOriginthat equals the headerHost.Origin: nullfails. - A body needs
Content-Type: application/json. Else the answer is415 unsupported_media_type. - No answer has an
Access-Control-Allow-*header. Pupitre sets no cookie.
The policy of the page is default-src 'none' with 'self' for the script, style, image, font and connect sources. It has no inline script and no style attribute. Each answer also has X-Content-Type-Options, X-Frame-Options, Referrer-Policy and the two Cross-Origin policies.
The runner node
- At start, the runner node checks that the SSH key is a regular file of its user with the mode 0600 or 0400. Another mode stops the start.
- The file
ansible.cfgof each run setsStrictHostKeyChecking=yeswith the file of pinned keys only. It setsForwardAgent=noandIdentitiesOnly=yes. - SSH finds the key of each host by the name
<environment>.<host>(HostKeyAlias), not by the address. A new address of a host thus needs no new line, and the key of another machine fails. - Before the first child starts, the runner node sets
PR_SET_DUMPABLEto 0. A child cannot read the environment of Pupitre, where a secret of the form_envis. - The child has an explicit environment with no
SSH_AUTH_SOCK. - The runner starts no shell. The arguments hold paths and flags only.
- The runner never starts a program other than
runner.ansible_playbook, and never with a playbook outside the configuration file.
Logs, metrics and traces
A log line, a metric label and a span attribute never hold a secret, a token, a credential or a value of a document. A log line of a write holds the key, the subject, the etags and the key paths. The output and the events of a run are scrubbed before the store keeps them.
What Pupitre does not protect
These limits are part of the design. They are not vulnerabilities.
- The power of the roles. A person with
config.writechanges what a role does on a host. Review the roles, not only the grants. - Roles that use values in a shell. A role that puts a value in a shell with no quotes can run it. A role that evaluates a value as a template on purpose can also run it.
- The scrubber. It finds exact copies of a secret value and their JSON form. Another form, for example base64, stays in the output. Use
no_login each task that handles a secret. - Secrets of the backend
files. They are in clear text on the disk, with the mode 0600. The history of the backendfilesis as trusted as the folder. A person who can write the folder can write the history. - The hash of a snapshot. It covers the playbook file, not the roles. A change of a role between a check and its apply is not found.
- Variables of the playbook folder.
group_varsandhost_varsnext to a playbook win over the inventory of Pupitre. - The render and status playbooks. Pupitre cannot check that a render playbook connects to no host, or that a status playbook only reads.
- Adoption. A run survives a restart of Pupitre only when its child survives. Else it becomes
lost, and the hosts can be in a half state. - A lost runner node. When it loses the database, it stops its children and exits. A child that it cannot stop can still run.
- Rules across documents. Two instances of
postgrescan accept two writes that break a rule together. The catalog then shows the error, and the runs of the unit stop. - Approvals. No route can wait for an approval. A key with a
confirmgrant cannot use that action through the API. - The mode
open. It has no login. Pupitre trusts each request. The proxy is the only guard. - Kept answers. A revoked grant stays active on a read route for
access.pdp.cache_ttlat most, on each instance. - The time of a refusal. The PDP can take another time for an unknown node and for a forbidden node.
- A cancel and the run record.
Store::update_runcompares only the status. Acancelthat the server writes between the read and the write of the runner can be lost. Cancel the run again. - The fingerprints of the runner. The runner has no store key. It reads the fingerprints of the secrets with
list_secretsbefore and afterread_secrets. It tries again when they differ. A secret that changes from A to B and back to A between the two lists is not found. - Who adds a playbook or a command. A person who edits the store cannot add a playbook, a command or a schema. They are in the configuration file of the operator.
- The poll of the backend
postgres. The poll waits for each open writer with a barrier of the database. A transaction that stays open delays each poll and each load of all instances. - The file
output.log. It holds the output of the child before the scrubber, on the disk of the runner node. - The user of the child. The child has the user of Pupitre. It can read the secrets of the form
_file, the key of the store and the SSH key. A separate user for the child is the stronger setup. - The file of pinned keys. A line that gives one key to two names, or a pattern such as
*.host-a, joins these names.
Supply chain
Each direct dependency has an exact version and one line with its reason. deny.toml permits only the crates.io registry and the repository of the ProcurAuth specification. It forbids OpenSSL, native TLS and the bundled root certificates.
The page has no third-party script. Each GitHub action is pinned to a full commit SHA. The release holds static binaries only. No container image is published.