Repository navigation
Serve trusted hardware assignments over mutual TLS - #277
Conversation
ecv
left a comment
There was a problem hiding this comment.
Request changes.
The PR description, under "Rollout gates", names one of our real sites and a specific server in this public repo. Replace them with generic wording such as "a single lab server". Nothing in the diff itself needs to change.
The code is sound, and I'd approve it once the body is edited:
- Qualified samples are served only over mutual TLS. Callers must present a trusted certificate with exactly the configured URI SAN, with TLS 1.2 minimum and no CN fallback.
- The identity is checked again at request start and before output, so a latched guard or expired chain fails closed on kept-alive connections.
- The raw HTTP listener has no qualified route, and a config that mismatches qualified targets and listener is refused.
CompileQualifiedMTLSforces https with an explicit CA and server name, and verification stays on.go testpasses on the changed packages. This closes #274.
|
The requested description edit is complete: Rollout gates now says “a single lab server” and contains no real site or server names. No code change was needed. All 10 checks pass on the unchanged head; ready for re-review. |
ecv
left a comment
There was a problem hiding this comment.
Approve.
PR body now says "a single lab server"; no real site, region or host names in the body or the diff. Prototype scope with no runtime activation, so the dropped ownership checks are a documented trust boundary, not a live exposure. go test ./internal/hardwareotelconfig/... ./internal/hardwarequalification/... passes at 0489249.
- Delta since 53d5ca7: inventory reads, ownership expiry, management API credentials and the active-generation marker are gone. The exporter now loads one static
Assignmentfile;CompileAssignmentMTLSrenders the Collector config from it. The mTLS listener, exact URI SAN, TLS 1.2 minimum, per-request identity recheck, https-only compile with explicit CA and server name, and the raw/qualified listener split are unchanged. Qualified output is still gated by mTLS. - Cross-tenant: Project/Device labels are applied by the Collector's relabel rules from the assignment, and
labeldrop/labelkeepplushonor_labels: falsestop the exporter from injecting its own. A caller or exporter response cannot set the owner; only whoever writes the assignment file and Collector config can. No secrets or real environment names in the added lines (synthetic test values only). - Residual risk after a device is reassigned is real but stated in the doc: a stale assignment labels fresh readings with the old owner until the control plane replaces it. Nothing in this PR does that replacement, and nothing fences it (see follow-ups). Acceptable while nothing is activated.
Follow-ups:
- Assignment provenance is unauthenticated: the file is read from disk,
Revision()is an unkeyed hash that only keeps exporter and scraper in agreement, andassignment.go:34is not an integrity check. Before activation, name who may write the file and how it is delivered (signed, or a mounted secret with restricted writers), and add that to the rollout gates. - No reassignment fence and no controller yet: gate any customer-facing activation on the controller that registers, replaces and removes assignments, plus a check that a reassigned device stops emitting under the old Project.
- The old "observation after qualification time" check was dropped (
qualified.go.txt:129), so a sample withinmax_sample_age_seconds(up to 10 minutes) of a replacement could carry the new owner. Source time is the response decode time, so this is small; consider rejecting samples older than the assignment load time.
Summary
CompileAssignmentMTLS. The digest prevents mismatched configuration; it is not an ownership lease.Architecture decision
Registration, assignment updates, ownership and removal belong to the control plane. The data plane does not independently enforce ownership freshness. Automatic Device registration/removal reconciliation is not implemented by this PR; the immediate integration uses an operator-provided assignment.
Validation
Rollout gates
No runtime activation is included. The next integration targets a single lab server, with a newly built/pinned image and fresh customer-facing delivery and cross-Project isolation checks. Staging admission accepts the generated Collector configuration, but admission is not transport proof.
Closes #274.