Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Changelog

All notable changes to MessageFoundry are documented here. The format follows
Expand Down Expand Up @@ -25,6 +25,25 @@
transport before that build, and the start was refused naming the CA. It now exits 2 before the
API listens, naming the settings and the primary remedy, and pointing to the `smtp_allowed_hosts` row of
the `[alerts]` table in `docs/CONFIGURATION.md` for the full steps. (`BACKLOG #6600`)
- **A channel-scoped caller's malformed flag request is refused 403, and audited, before it is
validated.** `POST /connections/{name}/flag` answered such a caller's direction that names
neither side or is missing, and a name that fails the connection-name rule, with a 422 and no
`auth.channel_denied` row. It now answers each with the 403 and an `auth.channel_denied` row, as
for a target outside the caller's scope; for a bad name the row names no channel and carries
`"malformed_name": true`. **This turns those 422s into 403s for such a caller.** A body sent as
JSON that does not parse is still a 422 with no row, as is any other fault in a request whose
name and direction pass. A body sent as any other type is refused too, with a row that carries
no `flag_direction_not_inbound` marker, since its direction was not read. An all-channels caller
still gets the 422.
(`BACKLOG #6638`)
- **A channel-scoped reader sees no alert rule id or connection labels.** `GET /security/posture`
labels a credential-reminder-silencing alert rule by its position alone for such a reader, as
`GET /alerts/rules` shows it no id. `GET /connections/{name}/metadata` returns that reader no
`metadata` labels, with the new `metadata_withheld` true. Both are operator free text, which may
name a connection outside the reader's scope. That route also gives such a reader an inbound's
`settings.reply_from`, which names an outbound, as null, with the new `reply_from_withheld`
true. `AlertRuleInfo` gained `id_withheld`, so a null id
no longer means both "unlabelled" and "withheld". (`BACKLOG #6638`)

## [0.5.3] — 2026-11-27 — Early Access

Expand Down
6 changes: 5 additions & 1 deletion docs/CONNECTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,11 @@ Two read/diagnostic endpoints back the console's connection view (auth + per-cha
- **`GET /connections/{name}/metadata`** (`monitoring:read`) — the connector type, the operator
`metadata` labels, running state, and a **secret-scrubbed** settings view (`env()` refs show as
`{"env": key}` and are never resolved; credential fields render as `"***"`). Inbound is per-channel;
a shared outbound is barred to channel-scoped users.
a shared outbound is barred to channel-scoped users. A channel-scoped user gets no `metadata`
labels, since they are free text that may name another connection, and `metadata_withheld: true`
(BACKLOG #6638), so put a runbook such a user needs somewhere it can read. Such a user also gets
an inbound's `settings.reply_from`, which names an outbound, as null, with
`reply_from_withheld: true`.
- **`POST /connections/{name}/test`** (`connections:test`) — a **reachability probe** that builds a
*fresh* connector (never the live one), honors the `[egress]` allowlist fail-closed, and **sends no
real message** — a socket connect (MLLP/TCP/X12), `SELECT 1` (Database), an HTTP `HEAD` (REST/SOAP),
Expand Down
41 changes: 28 additions & 13 deletions docs/SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -1879,7 +1879,7 @@ exempt like any other, and the save re-seals the row as it always has.
| `GET` | `/security/posture` | `monitoring:read` | `require` |
| `GET` | `/channels` | `monitoring:read` | `require` |
| `GET` | `/connections` | `monitoring:read` | `require_monitoring_read` — `error` gated on `messages:view_summary` and masked; the `reveal=<connection name>` act also needs `messages:view_summary` (BACKLOG #2443) |
| `GET` | `/connections/{name}/metadata` | `monitoring:read` | `require` — per-channel for inbound; a shared outbound is barred to scoped users; credentials scrubbed unconditionally; `error` gated on `messages:view_summary` and masked; the `reveal=true` act also needs `messages:view_summary` (BACKLOG #2443) |
| `GET` | `/connections/{name}/metadata` | `monitoring:read` | `require` — per-channel for inbound; a shared outbound is barred to scoped users; a channel-scoped reader gets no `metadata` labels, which are operator free text that may name another connection, and `metadata_withheld: true`, so a null `metadata` there means "not shown"; nor an inbound's `settings.reply_from`, which names an outbound such a reader may not reach, so it is null with `reply_from_withheld: true` (BACKLOG #6638); credentials scrubbed unconditionally; `error` gated on `messages:view_summary` and masked; the `reveal=true` act also needs `messages:view_summary` (BACKLOG #2443) |
| `GET` | `/events` | `monitoring:read` | `require` — data rule: *Single-route data rules* below (BACKLOG #1151) |
| `GET` | `/connections/{name}/events` | `monitoring:read` | `require` |
| `GET` | `/stats` | `monitoring:read` | `require_monitoring_read` |
Expand Down Expand Up @@ -2488,7 +2488,9 @@ the same permission set on the same method reds CI until it is listed here.
> `auth.gate_refused` and `auth.mfa_denied`). An admitted caller's grant row is written under the
> shipped default of `[security].audit_all_authorization_decisions`; with that switch off it is
> written on the POST routes, whose permissions are in the sensitive set, and not on the GET routes.
> The console checks the rule before it calls in. `record_channel_denied`
> The console checks the rule before it calls in, except on its flag route, which hands a
> channel-scoped caller's raw name to `refuse_connection_flag` first so the refusal is audited
> (BACKLOG #6638); there the bound below is the only one. `record_channel_denied`
> in `messagefoundry/api/message_scope.py`, which writes every `auth.channel_denied` row the API and
> the console seam record (`audit_channel_denied` and `refuse_a_channel_scoped_reader` call it), checks the name it is given against the rule too, and records a name
> that fails it as no channel, so `audit_log.channel_id` never holds a caller-chosen string of
Expand Down Expand Up @@ -2532,8 +2534,10 @@ the same permission set on the same method reds CI until it is listed here.
> A row naming an in-scope inbound has at least one more cause, on any deployment: a
> flag request refused for its direction. Such a row's detail carries
> `"flag_direction_not_inbound": true`, so a row without that marker was not refused for its
> direction (BACKLOG #3378). `POST /connections/{name}/flag` writes it for a direction of
> `outbound`, and the web console's flag route for any direction other than `inbound`.
> direction (BACKLOG #3378). Both flag routes write it for any direction they read other than
> `inbound`, a request that names none or a malformed one included. The JSON route reads a
> direction only from a body sent as JSON, so a scoped caller's body of any other type is refused
> with a row that carries no marker, since it may have asked for `inbound` (BACKLOG #6638).
> With an engine bound but not started there is no graph and no name exists. Every route still
> checks the scope first, so a name outside it gets the 403. A name inside it gets 503 from the
> first three routes and 404 from the control routes, with no denial row. With no engine bound at
Expand All @@ -2546,11 +2550,20 @@ the same permission set on the same method reds CI until it is listed here.
> whole config, so unlike the routes above, an in-scope inbound that a sibling engine shard holds is
> not refused by this one: the scope check does not refuse it, and `Engine.set_connection_flag` writes the flag
> and its `connection_flag_set` row to the shared store. What that method refuses is in its
> docstring. The JSON
> route validates the body before any of this, so a direction other than `inbound` or `outbound`
> gets a 422 there with no denial row, scoped caller or not. The web console's twin reads the
> direction itself: for such a direction it gives a scoped caller the 403 and a denial row, and an
> all-channels caller 404 with no row (BACKLOG #3378).
> docstring. Both flag routes, the JSON route and the web console's twin, run this refusal on
> the request's raw name and direction before they validate either (BACKLOG #3378, #6638). So a
> scoped caller whose direction names neither side or is missing, or whose name fails the
> connection-name rule, gets the 403 and a denial row marked `"flag_direction_not_inbound": true`
> for the direction, the row naming no channel for a bad name. Only the name and the direction
> are read first: a scoped caller's request on its own inbound with any other fault, such as a
> `flagged` that is not a boolean or an unknown key, is still a 422 with no row. So is a body
> sent as JSON that does not parse, for every caller, since the framework refuses it before the
> JSON route's refusal runs. Sent as JSON means the framework's own test: a Content-Type whose type
> is `application` and whose subtype is `json` or ends `+json`. A body of any other type, such as
> `application/x/y+json`, is not parsed, so it names no direction to a scoped caller and is
> refused, with a row that carries no direction marker. An all-channels caller gets the 422 for a
> malformed name or body, and on the console 404 for a direction that names neither side, with no
> row.
> `GET /alerts/rules` shows a scoped caller
> only the rules that name no connection outside its scope: `connection` is `*` or a name in its
> scope, and `control_target` is unset or in it. Each name a rule carries must also be an inbound
Expand All @@ -2573,7 +2586,8 @@ the same permission set on the same method reds CI until it is listed here.
> purpose. The batch Manager decided this on 2026-11-22. It read the owner's ruling as covering
> rules and flagging, not instances. What the ack, resolve, suspend and resume routes admit is in their bullet under
> *Single-route data rules*, below. Each rule it shows has a null `id`
> (BACKLOG #3378). The id is the operator's free-text label, so whoever writes `[alerts]` can put any
> and `id_withheld: true`, labelled or not, so a null `id` there means "not shown" (BACKLOG #3378,
> #6638). The id is the operator's free-text label, so whoever writes `[alerts]` can put any
> connection name in it, and nothing here reliably tells a label that names one from one that
> does not. An
> all-channels caller reads every id. A withheld id writes no audit row, since the rule itself is
Expand Down Expand Up @@ -2735,9 +2749,10 @@ the same permission set on the same method reds CI until it is listed here.
> own scope that the graph holds. That covers the loosenings, the static-credential hops and
> their opt-outs, and the audit row. `loosenings_scope` and `static_credential_hops_scope` then
> say the reading is narrowed, with or without a loaded graph. The audit row carries
> `loosenings_scope` too, and the console's status page shows it. The rest is shown whole. Some
> of it is operator free text, such as an alert rule's id or an attestation reason, which may
> name a connection.
> `loosenings_scope` too, and the console's status page shows it. An alert rule is labelled by
> its position alone, with no `id`, as `GET /alerts/rules` shows such a reader no `id` (BACKLOG
> #6638). The rest is shown whole. Some of it is operator free text, such as an attestation
> reason, which may name a connection.
> - `GET /users` sends each account's `channel_scope` and `channel_scope_source` only to a
> `users:manage` holder, the tier `GET /users/{user_id}/channel-scope` reads on. Everyone else
> gets null for both and `channel_scope_withheld: true`, so a null there means "not shown". The
Expand Down
16 changes: 15 additions & 1 deletion messagefoundry/api/_ui_seam.py
Original file line number Diff line number Diff line change
Expand Up @@ -1016,12 +1016,22 @@
#: the helpers a gate calls, so the digest moved. No engine surface changed. Re-derived with
#: ``--write``, from ``4033184244d47e90`` to ``be04f29ecb86c73b``.
#:
#: BACKLOG #6638: ``CoreHandlers`` gained ``refuse_connection_flag``, the engine's one flag-route
#: scope refusal, which the console's flag route now calls in place of its own copy, so the console
#: no longer imports ``api.message_scope.CONNECTION_DENIED_DETAIL`` (the blind spot the #3378 entry
#: above names). ``AlertRuleInfo`` gained ``id_withheld``. Re-derived with ``--write``, from
#: ``4033184244d47e90`` to ``649e40ac2b7f6902``.
#:
#: Merge of the #6638 entry with main after engine PR 3568 (#3771): each digest was derived without
#: the other's change, so neither held for the merged surface. Re-derived with ``--write`` over
#: both, from ``649e40ac2b7f6902`` and ``be04f29ecb86c73b`` to ``955191cd49e25c20``.
#:
#: The digest below covers the surface DISCOVERED from the console's own imports and uses, which is
#: strictly larger than the five hand-maintained tuples it replaced -- those had drifted, and the
#: proof is that commit 40a4d5d9 added a REQUIRED ``UploadedFileList.scope`` field the console renders
#: unconditionally while touching no seam file at all. Regenerate with
#: ``python scripts/webconsole_seam_snapshot.py --write``; never hand-edit it to silence a gate.
ENGINE_UI_SEAM: str = "be04f29ecb86c73b"
ENGINE_UI_SEAM: str = "955191cd49e25c20"


@dataclass(frozen=True, slots=True)
Expand Down Expand Up @@ -1117,6 +1127,10 @@ class CoreHandlers:
# arrives once a shutdown's drain has begun or reaches the engine's write lock after that. One
# still queued for that lock when its wait runs out is refused 503 instead.
set_connection_flag: Callable[..., Awaitable[Any]]
# BACKLOG #6638: the flag routes' one scope refusal (``_refuse_connection_flag``), which the
# console runs on the form's raw direction before it validates the form, so a channel-scoped
# caller's bad name or direction is the audited 403 the JSON route gives.
refuse_connection_flag: Callable[..., Awaitable[Any]]
# Dual-control approvals (ASVS 2.3.5, BACKLOG #1982): the console's Approvals page. The JSON
# gates are require(APPROVALS_APPROVE) on the list and require_paced(APPROVALS_APPROVE) on
# reject, so those /ui routes assert approvals:approve through require_ui, which paces a /ui
Expand Down
Loading
Loading