Repository navigation
feat(reaction): a route of one project with a scope per rule - #169
Merged
Merged
Conversation
An account that may write the signed inbox could file <A>.<bob key id>-reject.answer before Bob answered, holding an envelope for another approval or junk under a junk signature. The inbox left the first out alone and the plane left the second out as unauthenticated, so the batch read complete; Bob's reject then failed on the taken name and another operator's approval ran the call. A name spelling A in other letter cases took the same entry on a case-folding volume and was never listed for A. The inbox now counts every entry whose approval id matches A without case as named for A, and holds each file to its own label: the body's <keyId>-<decision>, or that with -2 to -16, under one signature by the body's key, with a body naming A. Anything else leaves the batch unjudged (causes misnamed, malformed, other_approval). The plane reads an answer that does not authenticate as unknown, lets a valid rejection win over unjudged files, and otherwise holds the call INDETERMINATE (cause batch_unjudged); a truncated batch stays unavailable. approvals approve and reject file under the next free fresh label when the name is taken, say so on stderr, and refuse once all sixteen are taken. An answer by a revoked operator, by the pinned policy key or with no signature now holds its call INDETERMINATE until a valid rejection, the hold's expiry or the file's removal, where another operator's approval used to run it. Signed-off-by: Konrad Karauda <konrad@karauda.com>
A volume that folds case or normalizes names can take a name holding a byte outside ASCII as the name an answer needs, by rules no comparison here reproduces (APFS folds "ß" onto "SS" and "st" onto "ST"), so such a name now makes every batch unjudged rather than being left out as foreign. approvals approve|reject passed over any taken name for a fresh label, the operator's own earlier answer included, so a second answer of the same decision was filed beside the first. A name this account's own file holds is now refused as filed; only another account's file is passed over, and the stderr line names it as such. Signed-off-by: Konrad Karauda <konrad@karauda.com>
…nedBy The uid comparison converted os.Geteuid's int to uint64, which gosec refuses; the shared helper also refuses a negative uid. Signed-off-by: Konrad Karauda <konrad@karauda.com>
ADR-0073 records the 0.20 reading of an answer's name (the approval id ignoring ASCII case, an ASCII-only label set) and that any valid rejection wins over files the plane cannot judge. The approvals concept, the signed operators guide, the command line reference, the status page's limits and the changelog say what an operator sees: the next free label when another account holds the name, the refusals, and that an unjudged file holds its call INDETERMINATE until a valid rejection, the hold's expiry or its removal. Signed-off-by: Konrad Karauda <konrad@karauda.com>
Signed-off-by: Konrad Karauda <konrad@karauda.com> # Conflicts: # CHANGELOG.md # site/docs/changelog.html
The answer's label scheme pushed the page past the reference budget of 1500 words. Six hand-written paragraphs say the same facts in fewer words; the generated help blocks are unchanged. Signed-off-by: Konrad Karauda <konrad@karauda.com>
Any account that may write the inbox can hard-link a file this account owns under the name an operator's answer takes. The signing command read "this account owns the inode" as "this is my earlier answer", refused, and filed nothing, so a linked file kept the operator's rejection out until the hold expired. The command now refuses as filed earlier only when the file at the name, read bounded and without following a link, is one envelope of the answer payload type whose one signature verifies under the operator's key and whose body is that key's answer to this approval with this decision. Anything else is passed over for the next free label, as another account's file is, and stderr names the taken file as "a file that is not this answer" with its owner. Signed-off-by: Konrad Karauda <konrad@karauda.com>
The CLI page, the signed operators guide and the changelog now say that `approvals approve|reject --key` refuses a taken name as filed earlier only for this account's own verified answer, and files under the next free label otherwise. An unauthenticated answer is counted under `unauthenticated`; a file the plane cannot hold to its name is `misnamed`, which `/healthz` shows, and a name outside ASCII is removed by hand. ADR-0073's amendment and the status limit say an inbox writer can hold a call `INDETERMINATE` by truncating the batch, a valid rejection notwithstanding, but cannot make one run. Signed-off-by: Konrad Karauda <konrad@karauda.com>
Signed-off-by: Konrad Karauda <konrad@karauda.com> # Conflicts: # CHANGELOG.md # site/docs/changelog.html
On a volume that folds case, a valid rejection linked under another spelling opens through the exact name, while the plane counts that entry misnamed. The command now treats the name as taken by this answer only when the directory lists it byte for byte. Signed-off-by: Konrad Karauda <konrad@karauda.com>
Signed-off-by: Konrad Karauda <konrad@karauda.com>
The command opened the inbox once but then checked the owner of a taken name and the directory's listing by path again, so moving the inbox and putting another directory at its path could make it refuse an answer as filed earlier while the real inbox held only another spelling. Both now go through the opened directory: Inbox.Lstat and Inbox.ListsExactly. The listing reuses the plane's, bounded at 4096 names and 16 answers per approval; past a bound, or when it cannot be listed, the name counts as not listed and is passed over. When the passed-over file is this account's own answer under a name the plane may not read, stderr now says so instead of calling it a file that is not this answer. The spelling test skips, with its reason listed in expected-skips.txt, on a volume that does not open the other spelling through the exact name, and covers U+017F, which APFS folds onto "s". Signed-off-by: Konrad Karauda <konrad@karauda.com>
The command refused "filed earlier" for this key's answer to the same approval id and decision, whatever tenant, project, request, action digest or bundle digest it named, while the plane leaves such an answer out as another hold's. It now compares every member the plane compares. Signed-off-by: Konrad Karauda <konrad@karauda.com>
One tenant under every authority: a listener.principal.tenant_id apart from tenant_id is now refused at load under directory and memory as under signed, naming both keys. A claim read from approvals.dir, or from the memory store, now carries the authority, tenant and project its record names, and the plane takes it only when they are the directory kind and the hold's own tenant and project. A claim that names another, and a 2.0 record, which names none, leave the hold standing: the retry is INDETERMINATE, a restart closes it APPROVAL_STATE_UNKNOWN, and the plane counts an answer of another hold. Signed-off-by: Konrad Karauda <konrad@karauda.com>
The unsigned pause file moves to schema_version 5, which names tenant and project. A plane reads a file of another tenant or project as unknown and blocks every call, as it does under any unreadable pause file. Versions 1 and 2 are refused, naming pause init --tenant --project, which rewrites such a file as version 5 with its entries. pause add, pause remove and the console keep the file's tenancy; state restore carries a version 2 backup as version 5 of the plane's tenancy and refuses another one. The signed file stays version 4. Signed-off-by: Konrad Karauda <konrad@karauda.com>
parseAny reads the head and the entries in two functions, and the tests that grew past the complexity bound are split, each read error checked. Signed-off-by: Konrad Karauda <konrad@karauda.com>
Outside signed the route is reaction-route/v1alpha4: it names project_id, and each rule a scope of run, agent or principal; agent and principal need expires_seconds and are taken only for REPEATED_DENIAL 2. A plane refuses a route of another project, naming both (ADR-0089). Its list is 4.0: stop and covered lines add project_id, scope and subject; a lift line names scope, subject and through_line and holds a reaction-lift/v1alpha4 envelope signed by the route's lift key. A stop, covered line or lift of another tenant or project, and a lift not signed by the lift key, are refused. A v1alpha1 route and a 1.0 list are refused naming route sign and stops init; nothing is carried from them. A plane over a v1alpha1 route starts with its stop state unknown and blocks every call; state restore refuses both before its first write. route sign, stops init, react, stops lift (--run, --agent, --principal) and stops list write and read the new formats. Signed-off-by: Konrad Karauda <konrad@karauda.com>
…e-tenant Signed-off-by: Konrad Karauda <konrad@karauda.com> # Conflicts: # CHANGELOG.md # cmd/guardana-control/approvals_sign.go # cmd/guardana-control/approvalssquat_test.go # docs/reference/cli.md # internal/gateway/authority.go # internal/gateway/signed_helpers_test.go # site/docs/changelog.html # site/docs/reference/cli.html
Signed-off-by: Konrad Karauda <konrad@karauda.com>
Init reads the file it would carry through ReadUnsignedV2 and wraps the cause of a refusal: a version 5 file, a signed one, one it cannot parse, or the mode or owner a plane's read refuses. Merge decodes its backup through the same reader, which now refuses a signed file itself. Under the signed authority a write to an unsigned file of version 1 or 2 answers ErrUnsigned, as the plane's read does. The signed header checks its tenancy through Tenancy.Check, the worst-case file of a 256-byte tenancy is pinned inside the byte bound, and the versions page lists the versions the code writes and reads. Signed-off-by: Konrad Karauda <konrad@karauda.com>
A claim whose record names another tenant, project or authority is judged before the duplicate check, so a good claim filed first no longer hides it from the other_hold count. Signed-off-by: Konrad Karauda <konrad@karauda.com>
Outside the signed authority, with pause.file set, a tenant_id or project_id past the pause file's 256-byte bound is refused at load, naming the key, instead of failing when the plane starts its poller. Signed-off-by: Konrad Karauda <konrad@karauda.com>
pause list opens an unsigned file's listing with its tenant and project and says that a plane of another reads the file as unknown; the console says the same of every readable file, signed ones included, and the scenario runner skips the line. The help shows --tenant and --project as required for pause init, and the command line page follows it. Signed-off-by: Konrad Karauda <konrad@karauda.com>
update asks writeKind whether the file it read is of the write's kind, which keeps update under the complexity bound, and the memory claim test carries each case's count beside its outcome. Signed-off-by: Konrad Karauda <konrad@karauda.com>
…an old rule Under the signed authority a v1alpha1 body is refused as any other kind, before its signature is read, so a plane over a file no one signed refuses to start instead of starting blocked. Outside signed a plane over a v1alpha1 route signed by the route key still starts with every call blocked, and doctor now says so instead of saying run refuses to start. Under a v1alpha4 route an agent or principal stop of a superseded or retired rule version is refused: those scopes stop only under REPEATED_DENIAL version 2 (ADR-0089). A run's stop of such a version is still kept, since a carry from a route naming it writes one. Comments describing the retired formats no longer tell their history. Signed-off-by: Konrad Karauda <konrad@karauda.com>
…oject ADR-0089 is accepted for its receivers: the listener's tenant, directory and memory answers and the unsigned pause file version 5. The pages, the configuration reference and the changelog say what a plane outside signed now refuses, and how to upgrade a pause file and a pending hold. Signed-off-by: Konrad Karauda <konrad@karauda.com>
…e-tenant Signed-off-by: Konrad Karauda <konrad@karauda.com> # Conflicts: # CHANGELOG.md # docs/backlog.md # site/docs/changelog.html
…pha4 Signed-off-by: Konrad Karauda <konrad@karauda.com>
…tops Under the roster, rosterRoute read the route's body before verifying it, so an envelope of the operator payload type around a v1alpha1 body no one signed answered with the retired route's remedy, which names route sign and stops init, both refused under signed. It now answers as any other kind, as the plane's own signed reader does. Signed-off-by: Konrad Karauda <konrad@karauda.com>
The pages, the record and the changelog say what the v1alpha4 route, the 4.0 stop list and the v1alpha4 lift do outside signed, what a 0.19 plane meets on upgrade, and that a v1alpha1 route starts a plane with every call blocked while a 1.0 list under a v1alpha4 route refuses the start. Signed-off-by: Konrad Karauda <konrad@karauda.com>
Signed-off-by: Konrad Karauda <konrad@karauda.com>
Signed-off-by: Konrad Karauda <konrad@karauda.com>
🚀 Deploying Preview to Cloudflare 🚀Preview Deployments by commit
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed, and why
Outside
approvals.authority: signed, the key atreaction.public_keysignsreaction-route/v1alpha4. Required members arekind,route_id,serial,tenant_id,project_id,lift_public_keyandrules. Each rule setsscopetorun,agentorprincipal. There is no route-widescope. Theagentandprincipalrules requireexpires_secondsand apply only toREPEATED_DENIALversion2. The route must match the listener's tenant and the plane's project. The plane refuses a project mismatch and names both project ids. Undersigned,v1alpha3stays andv1alpha4is refused.A
v1alpha4route uses a4.0list. Itsstopandcoveredlines addproject_id,scopeandsubject. Aliftline namesscope,subjectandthrough_lineand holds areaction-lift/v1alpha4envelope. The reader refuses lines from another tenant or project. It requires each lift to be signed by the route's lift key and bound to the line's scope, subject, list and route. Agent and principal stops count only for currentREPEATED_DENIALversion2. A run stop of a superseded or retired rule version is kept as before.reactwrites4.0lines with the finding's project, the rule's scope and the run's subject.stops lift --agent <id>andstops lift --principal <id>work with--public-keyas well as undersigned. Until per-caller principals land, an agent or principal stop matches the configured listener agent or principal in the plane's project and blocks every call on that plane until it expires or is lifted.Outside
signed,reaction-route/v1alpha1routes and1.0lists are refused withroute signandstops initas remedies. Nothing is carried from either. Over av1alpha1route, the plane starts with every call blocked bySTOP_STATE_UNAVAILABLE, stop stateunknownand causeanother format version. Thedoctorcheckreactionfails withrun starts on it with every call blocked. A plane over av1alpha4route whose list is still1.0refuses to start, namingstops init. Before its first write,state restorerefuses a backup containing a list under av1alpha1route or a1.0list.Under
signed, the plane,doctorand thestopscommands reject an operator-payload envelope around av1alpha1body as another kind before reading any signature. This avoids directing operators to commands thatsignedrefuses.Invariant or record
This implements the route part of ADR-0089. Outside
signed, each route names one project and each rule names its scope. The receivers part landed in the previous change.How it was tested
internal/reaction/route4_test.go, thev1alpha1refusal namingroute signandstops init,TestASignedPlaneRefusesToStartOverAnUnsignedRetiredRoute,TestAV1Alpha4ListHoldsAWiderStopOnlyOfRepeatedDenialTwo,TestDoctorSaysAPlaneOverARetiredRouteStartsBlockedandTestASignedCommandRefusesAnUnsignedV1Alpha1RouteAsAnotherKind. The base could not read av1alpha4route.stoplines orcoveredlines, the lift signer, lifetime or scope-rule check, or the signed retired-route mapping. They also killed mutants that acceptedv1alpha1or1.0or let a refused poller read. Tests caught disabling thev1alpha4wider-stop check or applying it to every scope, and disablingdoctor's retired-route message or using it for every error.v1alpha1bodies, rejected wider stops from superseded or retired rule versions, and correcteddoctor's startup wording and history comments. The security re-check found no fail-open and one low-severity issue. This PR fixes it by makingstopscommands undersignedreport another kind for an unsignedv1alpha1body.internal/reaction(194),internal/reaction/stopwrite(71),internal/reaction/stoplist(31),internal/gatewayconfig(657),internal/recovery(141),internal/gateway(1389),internal/console(58),internal/pause(196),cmd/guardana-control(802),cmd/guardana-gateway(915) andmake docs-checkpassed.internal/recoverypassed all 141 tests.internal/reactionrecorded 193 passes and one failure.TestReactionReachesNoFindingCodecould not rungo listbecause the container lackedgo. Linux coverage excluded tests that build a binary, rungo listor need filesystem ACLs. End-to-end retired-route tests ran only on macOS.v1alpha4route naming a retired rule version. That case has no dedicated test. Principal matching against the authenticated caller comes next. Localmake qualitywas not run. CI'smake qualityis the gate.Documentation
Amended ADR-0089 to record startup refusal for a
1.0list underv1alpha4and added the ADR-0046 pointer. Indocs/contracts.md, updated the route, stop list and lift sections and the "Route under a route key" row. Updateddocs/reference/reaction.md,docs/reference/reaction-signed.md,docs/reference/versions.md,docs/status.md,docs/concepts/control-and-supervision.md,docs/concepts/glossary.md,docs/concepts/privacy.mdanddocs/concepts/signed-operations.md. Also updated "Supervise and stop a run", "Upgrade a plane from 0.17",README.mdand the site. TheCHANGELOGChangedentries give the upgrade steps for a0.19plane.