Skip to content

fix(auth): remediate database TLS and passkey enrollment - #10

Closed
PiquelChips wants to merge 11 commits into
auth/08-hardening-operationsfrom
auth/security-audit
Closed

PiquelChips wants to merge 11 commits into
auth/08-hardening-operationsfrom
auth/security-audit

Conversation

@PiquelChips

@PiquelChips PiquelChips commented Jul 14, 2026 •

Copy link
Copy Markdown
Member

Outcome

The authentication review's in-scope release blockers are remediated in b79449c.

Resolved

  • PostgreSQL configuration is parsed into PgConnectOptions once and the validated options are passed directly to SQLx. Production requires one unambiguous verify-full setting; duplicate sslmode/ssl-mode parameters and query-level host/hostaddr overrides are rejected.
  • Authenticated backup-passkey enrollment is enabled by forward migration 0007, with PostgreSQL integration coverage for inserting and consuming the enrollment ceremony kind.

Explicitly deferred

Per the current release scope, this PR does not address:

  • email-only federation auto-linking;
  • signing and opaque-token key rotation;
  • production deployment topology, proxy boundaries, TLS provisioning, or production observability.

The remaining non-blocking observations and future hardening recommendations stay documented in the review report.

Report

Full architecture and security review

Verification

Locally passing: Rust formatting, strict Clippy, workspace tests, Svelte checks, Vitest, four Chromium flows, Cargo advisories, and the high-severity pnpm audit threshold. The complete migration chain was also applied to a clean PostgreSQL 17 database and accepted an enrollment ceremony. The package audit continues to report one pre-existing low-severity advisory.

The pushed CI workflow validates the PostgreSQL-backed identity, HTTP, and RPC suites in addition to these local gates.

@PiquelChips PiquelChips added enhancement New feature or request documentation Improvements or additions to documentation and removed enhancement New feature or request labels Jul 14, 2026
@PiquelChips PiquelChips self-assigned this Jul 14, 2026
@PiquelChips
PiquelChips marked this pull request as draft July 14, 2026 13:31
@PiquelChips PiquelChips added security Anything security related apps/auth-service Origin Auth at auth.sourceorigin.dev, its settings and developer console, and the operator CLI labels Jul 14, 2026
@PiquelChips
PiquelChips force-pushed the auth/security-audit branch from 5642887 to 8e7f9d9 Compare July 14, 2026 14:06
@PiquelChips PiquelChips changed the title docs(auth): record stack security review docs(auth): record audit and remediation evidence Jul 14, 2026
@PiquelChips
PiquelChips changed the base branch from auth/08-hardening-operations to main July 14, 2026 14:11
@PiquelChips
PiquelChips changed the base branch from main to auth/08-hardening-operations July 14, 2026 14:11
@PiquelChips PiquelChips changed the title docs(auth): record audit and remediation evidence docs(auth): record second stack security review Jul 14, 2026
@PiquelChips
PiquelChips force-pushed the auth/security-audit branch from cdbdfb7 to fb5e93d Compare July 14, 2026 15:38
@PiquelChips
PiquelChips force-pushed the auth/security-audit branch from fb5e93d to 114273c Compare July 14, 2026 15:40
@PiquelChips PiquelChips changed the title docs(auth): record second stack security review docs(auth): record stack review and remediation Jul 14, 2026
@PiquelChips PiquelChips changed the title docs(auth): record stack review and remediation docs(auth): final architecture and security review Jul 14, 2026
@PiquelChips

Copy link
Copy Markdown
Member Author

The fresh architecture and security review is complete and the PR has been updated with a changes requested decision.

The full evidence, severity ranking, required fixes, validation performed, and merge criteria are in docs/security/auth-stack-review-2026-07-14.md. The branch now contains the replacement review at 91e313a.

@PiquelChips PiquelChips changed the title docs(auth): final architecture and security review fix(auth): remediate database TLS and passkey enrollment Jul 14, 2026
@PiquelChips

Copy link
Copy Markdown
Member Author

Implemented the two in-scope remediations in b79449c: the database now connects with already-validated PgConnectOptions and rejects TLS/host override ambiguity, and migration 0007 enables authenticated passkey enrollment with integration coverage. Federation auto-linking, key rotation, and production deployment concerns remain explicitly deferred per scope. Full CI is running on the pushed commit.

@PiquelChips

Copy link
Copy Markdown
Member Author

Remediation validation is complete: CI run 29353067560 passed every gate, including the PostgreSQL-backed identity test with the new enrollment ceremony assertion, HTTP/RPC integration suites, strict Clippy, browser tests, dependency audits, and the Traefik topology exercise.

@PiquelChips
PiquelChips changed the base branch from auth/08-hardening-operations to main July 14, 2026 18:55
@PiquelChips
PiquelChips changed the base branch from main to auth/08-hardening-operations July 14, 2026 18:56
@PiquelChips
PiquelChips changed the base branch from auth/08-hardening-operations to main July 15, 2026 12:04
@PiquelChips
PiquelChips changed the base branch from main to auth/08-hardening-operations July 15, 2026 12:04
PiquelChips added a commit that referenced this pull request Sep 12, 2026
The prototype cannot complete the intended passkey/social/OIDC flows,
and its stacked PRs add unsafe email linking and extra runtimes.

Replace that stack with one PostgreSQL-backed Rust auth binary
containing static login/onboarding/consent pages, plus a separate
piquel.fr settings frontend. Passkeys authorize a reusable two-minute
settings window; social signup requires a first passkey, and provider
linking requires explicit passkey proof. Add minimal CLI invitations,
configured OIDC clients, consent, RS256 tokens, refresh rotation and
logout. Remove unused prototype modules and superseded plans.

Validation: 24 backend tests passed with none skipped, including real
PostgreSQL, signed WebAuthn assertions and signed provider fixtures.
Real Chromium exercised signup, cross-origin settings, passkey
management, OIDC consent/PKCE, RS256 verification, userinfo and SSO.
Release build, frontend checks, Clippy, and Rust/npm dependency audits
passed. Live provider credentials and physical Apple/Google passkey
devices remain unverified.

Supersedes #4, #5, #6, #7, #8, #9 and #10. Requires a fresh database;
prototype compatibility and deployment are outside this release.

Model: GPT-6. Harness: Codex.


<!-- Macroscope's pull request summary starts here -->
<!-- Macroscope will only edit the content between these invisible
markers, and the markers themselves will not be visible in the GitHub
rendered markdown. -->
<!-- If you delete either of the start / end markers from your PR's
description, Macroscope will append its summary at the bottom of the
description. -->
> [!NOTE]
> ### Add passkey-first authentication service with OIDC, federation,
and web apps
> - Rewrites the auth service to support passkey sign-in, registration,
social identity linking, enrollment, and management flows
> - Adds OIDC client management, RS256 token signing/verification, and
GitHub/Google federation repository support
> - Introduces SvelteKit frontends for authentication and settings,
which are built and embedded as static assets in the service
> - Adds database migrations for OIDC, federation, security, and removes
`internal_events` and `purpose_authorizations` tables
> - Risk: `configuration.SecretReference` rejects KMS URIs,
`auth-protocol` removes `AccessTokenClaims` and `text_id` macro, and
`PasskeyApplication::new` rejects subdomain and non-HTTPS origins
>
> <!-- Macroscope's review summary starts here -->
>
> <sup><a href="https://app.macroscope.com">Macroscope</a> summarized
4738fba.</sup>
> <!-- Macroscope's review summary ends here -->
>
<!-- Macroscope's pull request summary ends here -->
@PiquelChips

Copy link
Copy Markdown
Member Author

Superseded by the merged minimal authentication release in #12, which replaces this prototype stack and includes the relevant functionality within the agreed release scope.

Model: GPT-6. Harness: Codex.

@PiquelChips
PiquelChips deleted the auth/security-audit branch November 10, 2026 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

apps/auth-service Origin Auth at auth.sourceorigin.dev, its settings and developer console, and the operator CLI documentation Improvements or additions to documentation security Anything security related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant