Page revisions
6 Commits
6 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
| 1352343acf |
feat: the packages list laid out and working as the AUR's: search criteria, sortable headings, pages, popularity; votes say the day they were cast
- src/folio-list.h (new): the list shared by folio-generate and folio-search: the row of search criteria (Search by, Keywords, Out of Date, Sort by, Sort order, Per page, Go, Orphans), the headings that sort (Name, Votes, Popularity, Maintainer, Last Updated; the current one turns the order round), the rows (Name, Version, Part, Votes, Popularity, Description, Maintainer, Last Updated; a flagged package's version marked), the order (ties by name). - folio-search: the question's parts as the AUR names them (q, SeB, outdated, SB, SO, PP, O, submit=Orphans), each one of a fixed list or at most nine digits, else the default. Search by name and description, name, exact name, keyword, maintainer, co-maintainer, both, submitter; no words lists every package. "N packages found. Page X of Y." with First, Previous, pages, Next, Last, above and under the table. No 200-match cap: up to 200000 matches (64 MB) kept and sorted. A line of the index cut off, and the rest of it, is skipped. Popularity is carried on from the day it was reckoned. - folio-generate: every package gathered once; the packages page is the list, most popular first, with the criteria and sorting headings when the search is on (one plain page without it). index.tsv has 14 fields (co-maintainers, submitter, flagged, newest upload, popularity, its day, whether the maintainer has a page); packages.json gains "popularity". The search page holds the default form between <!--folio:form--> and <!--folio:results-->. - Popularity as the AUR's: each vote weighs 0.98 for every day since it was cast; older than ten years, nothing. folio-door's vote writes "cast = YYYY-MM-DD" into votes/ACCOUNT; a vote without it counts as cast on the package's first upload (submitted). - folio.css: the criteria row, compact so that it fits across the page from a window about 1024 pixels wide (it wraps on a phone); the table smaller, every column fitting at that width, and scrolling by itself when wider than the window; the count and pages; sort marks on the headings. The theme's colours. The count is div.pager, not the home page's .stats, whose style lifted it over the criteria and so caught every click on their controls. - Docs: design.md/.html (4.3, the record's layout, the limits table), Public Guide. - Tests: the criteria coming back as asked, unknown choices as the default, each search-by, the out-of-date filter, Orphans, pages past the end, the headings' links, a vote's day, popularity of today's, old and undated votes, a flagged version marked. Fuzz harness and seeds for the new index and question; regress input updated; the count's own class. make test: passed 2355, failed 0. Tried on the test site (bin/update) in Chromium at 1024 and 1366 pixels wide. |
|||
| 6bcd9fedcd |
feat: setup.sh finds the computer's release (Debian sid, Devuan testing and unstable); pages name a release's distribution; tried for real with Debian trixie
- setup.sh (server/apt-setup.sh.in): the release is the suite the computer's own apt uses (sources.list, sources.list.d .list and .sources; unstable is sid on Debian and ceres on Devuan, testing the testing release's name), else a word of VERSION_CODENAME, the first the site builds for. Before, it took VERSION_CODENAME alone: Debian unstable says forky there, and Devuan's testing and unstable both say "freia ceres", which wrote a broken deb line. New --release NAME. Stops before changing anything, saying what it found, when the site builds for none. folio-publish writes the site's releases into it (@RELEASES@). Only the shell is used to read apt's files. - folio-generate: a release of another distribution is shown with it, "trixie (Debian)", on a package's page (Built for, now also when it is built for all the site's releases), the builds list and each build's page; the home page says "Community packages for Devuan and Debian", the guides "Devuan or Debian"; the install guide lists the releases (@RELEASES@). - Docs: Public Guide, Troubleshooting (the new setup.sh messages), Settings Reference, How It Works, design.md/.html, the install guide; audit addendum with the real builds. - Tried for real on the test site: build systems made by mmdebstrap --keyring for Devuan freia and Debian trixie; hanshi built for trixie and was published in trixie/main (1.8+r19.g69f6a07+deb13). - Tests: setup.sh on stand-in Debian sid and testing and Devuan testing/unstable computers, --release, the refusal; the pages for a Debian release. make test: passed 2324, failed 0; make test-all: passed 2239, failed 0. |
|||
| 3c194c7c8b |
security: audit rounds 6 and 7, recovery and the web side: safe backups and restores, revocations that reach apt, pinned keys on nodes, a hardened web server
Round 6, backups and restores: - git never obeys settings, hooks or attributes of a record that came from elsewhere (A33): git_clean and record_own_copy (folio-lib.sh), fv_git and fv_own_copy (folio-verify.sh) for admin verify and folio-audit. Backups leave out the record's .git config, hooks and info, and GnuPG's *.conf; a restore writes a fresh config made by Folio and says what it left out. - Root splits a backup in a folder of its own (A34): the signer's part goes straight to folio-sign through a whitelist (no *.conf, no links, no extra files), and folio gets only the rest. A backup with a link, a hard link out, a ".." member or anything a backup does not hold is refused with nothing unpacked. - An older backup no longer undoes a change of keys (A35): a restore and every folio-key import merge the newest public key known (the owner's copy, the forge's record; folio-key merge FILE), so a revocation is never lost; the signer drops revoked keys' secrets. The record is pushed to the forge only as a fast-forward, except right after a signed erasure. Requests signed before a restore are refused. - A restore from the forge alone checks the forge's record against the old key first (folio-key record OLD-KEY.asc) and refuses one that does not hold (A36); the setup can keep the existing master (an emergency bundle). - The site builds its copy for the forge on the forge's history only if the site signed its newest commit (A42). Round 6, keys, apt and nodes: - After an emergency or a revocation, the archive is signed by the new and the outgoing key together for a while (A37), so computers with the old keyring take the keyring package with the revocation at their next upgrade; folio-key show lists the outgoing keys. - setup.sh installs exactly the keyring package version the site serves and compares its key file byte for byte (A43). - verify and folio-audit follow the first-parent line, judge a back-dated commit at its parent's time, and let a replaced key hold only until its successor signs (A38). - folio-site-key revoke-old revokes exactly the keys the change made old (recorded by new-signing-key, or named with --new), never by date, and new-signing-key refuses while the clock is behind (A39). - A changed SSH host key is fetched again over https and shown, old and new, for the person to confirm: the folio command (folio --site NAME --host-keys), the desktop program, and nodes (folio-node trust-host-keys) (A40). The break-in steps cover the host keys and the https key. - Nodes take the archive-only keyring and require site-key-fpr, the site master's fingerprint, giving a build the site's archive only with a key under it (A41). - Tests: the sections that shared the stand-in forge get their own repositories and the forge's current key. Round 7, the web side: - The theme links take only a local path from the Referer (A44); the port-80 redirect names the site's own host. - Imports refuse control characters and text that is not UTF-8 in every field they keep (A45); the generator's HTML, XML, JSON and index writers drop control characters and write U+FFFD for invalid bytes, so feed.xml and packages.json stay valid. - The door's listings write control characters out as text (A46). - Strict-Transport-Security in every https mode (A47); front mode says the front server should send it too. - The search is limited per address, 10 a second with bursts of 20 and 4 at a time, answering 429 (A48); real_ip for front mode is documented. - The home page shows setup.sh's SHA-256 beside the master's fingerprint; the theme cookie is Secure and HttpOnly; a Permissions-Policy turns off browser features no page uses; apt's index and setup.sh are served with Cache-Control: no-cache. - nginx_file moved into folio-lib.sh, tested in every https mode. - folio-node: the site-key-fpr message says 40 or 64 hexadecimal digits, as the check takes. - Docs checked against the code after both rounds: site-key-fpr in every node recipe (Quick Start, INSTALL, the Build Node Guide, the on-site node guide); the host-key confirm flow (folio --host-keys, folio-node trust-host-keys, the desktop's window); the 90-day double signing after an emergency; the import caps and refusals in packaging; the restore steps; FOLIO_SITE_KEY_PUBLIC and the fixed limits in the Settings Reference. - doc/security-audit.md and .html: rounds 6 and 7 (A33-A48, what held) and their fixes, the integration note. - Tests: make test passes 2216 and 234 desktop checks; make test-all passes 2131; make cppcheck and make analyze pass. |
|||
| 7869703eb2 |
security: master key off the server, signer user, sandboxed node steps, build limits, forge setup at install, audit fixes
- Security audit: doc/security-audit.md and .html, the living audit
document for outside auditors (baseline
|
|||
| a39dc8d0da |
security: every change signed by whoever made it, https only, key rotation, pinned host keys, hardened builds, folio-audit
- Signed changes: every door command that changes anything must come as a request signed with the person's own GPG key (folio-request 1: the site, the account, the exact command, the input's sha256, the time, a one-time nonce). The door checks the signature against the account's key in the record, that the SSH account and the signer are the same, the site, a five-minute window and that the nonce is new, before it runs anything. A stolen SSH key alone changes nothing. Read-only commands still work with plain ssh. Each change keeps its signed request in the record commit (Acted-by:, Request:). - New package folio-client: the folio command (signs through gpg-agent, pins the site's SSH keys) and folio-mykeys; folio-desktop depends on it and signs every change itself. - Keys: the owner's GPG key is required at install (folio-setup --owner-pgp for an older site or a lost key); vouch and admin node add take an SSH key and a GPG key; admin pgp sets someone's key; an account without one can only look. - Build nodes have their own GPG key and sign every claim and result; the node door checks the result's sha256 before unpacking it, and folio-publish refuses a result that was not signed. - The site's own changes name what authorised them (Authorised-by:, Source-commit: HASH signed-by FPR); record/verify/site-key.asc. - folio-audit (in folio-client): checks a copy of the record with only public keys: every site signature, every person's request, that what each change touched fits the command signed, the trailers of the site's own changes, and with --builds the nodes' signed results. New wiki page Auditing a Site. - https only: every address the site or a node fetches from must be https (follow, watch, watch-forge, mirrors, registry-to, the site's address, the distribution mirror, the node's clone); http and git addresses are refused, with no loopback exception; every curl is held to https; folio-install has no plain-http choice. The default mirror is https://pkgmaster.devuan.org/merged (deb.devuan.org's certificate does not cover its name). - Host keys: the site publishes its SSH host keys at /ssh-host-keys with their fingerprints on its pages; the desktop program, the folio command and build nodes pin them (no trust on first use). The forge's SSH key is confirmed by an administrator's fingerprint before the site sends anything (admin publish-to ADDRESS FINGERPRINT). - Key rotation: the site publishes its keyring package (WORD-archive- keyring), which apt keeps up to date; folio-key new-signing-key, switch (also after signing-key-overlap), revoke-old, renew, emergency; signing keys run out (signing-key-lifetime) and are renewed ahead. setup.sh needs gpg (or --no-check), installs the keyring package and writes no deb-src line. - admin verify: strict across rotations; changes signed with a stolen key before its revocation fail until the owner has reviewed them (admin verify accept); a signed log of key changes. While the signing key has run out or is revoked, the site takes no changes. - Review: signatures = required on a new site; only the owner approves the owner's work; administrators approve their own and others' but not the owner's; maintainers and members always need an administrator or the owner; rebuild keeps the uploader and records rebuilt-by, so it approves nothing. - Builds: a build that can never succeed on a release fails with the reason (needs X, which RELEASE does not have); one waiting for a package of this site is built again when that is published; .folio releases =; three node errors in a row make a build failed; a clone failure is the node's error; caches unused for over a week are deleted; links that leave the project are refused. - Hardened builds: CPPFLAGS and LDFLAGS reach the compiler, _FORTIFY_SOURCE=3, stack protector, stack clash, CET, PIE, relro and now; -Wconversion and the stricter warnings, fixed without casts; make analyze, cppcheck, test-asan, fuzz-search, fuzz-record. Fuzzing and the sanitizers found a heap over-read in folio-generate and two cases of undefined behaviour in folio-search; all fixed. - Desktop program: refuses to send a private key; runs ssh, gpg and curl by full path; the Site dialog has the web address and the site's fingerprints; owner-only Accept doubted changes; tooltips that say what each button does. - Erasing also removes refused imports, needed-package notes, pages and signed requests that name what was erased; rate limit for imports (limit-import); admin move moves what is published; admin set of the address rewrites setup.sh; a failed setup takes away what it made. - Docs: the wiki checked against the code and rewritten to explain what each thing is and how the steps go; new Quick Start and Auditing a Site; doc/design, INSTALL, packaging and erasing as .md and .html (doc/doc.css); the on-site guides. - Tests: make test passes 1362 and 102 desktop checks; make test-all passes 1313. tools/folio-local is replaced by the security-test setup. |
|||
| fe6369aa69 | docs: wiki checked against the code; backup, key and erase fixes; removing builds |