Skip to content

Add cert auth for iOS/iPadOS My Device page - #35009

Merged
cdcme merged 5 commits into
feat-32247-ios-ipados-self-servicefrom
feat-34258-my-device-webclip-profiles
Nov 4, 2025
Merged

Add cert auth for iOS/iPadOS My Device page#35009
cdcme merged 5 commits into
feat-32247-ios-ipados-self-servicefrom
feat-34258-my-device-webclip-profiles

Conversation

@cdcme

@cdcme cdcme commented Oct 30, 2025

Copy link
Copy Markdown
Member

Implements #34258. Adds certificate authentication for the My Device page on iOS/iPadOS.

Summary

iOS and iPadOS devices don't run Fleet Desktop, so they can't use token-based authentication for the My Device page. This implements certificate-based authentication using Fleet Identity certificates already issued during MDM enrollment.

Load balancer extracts certificate serial from mTLS connection and passes to Fleet via X-Client-Cert-Serial header. Fleet validates the certificate matches the device UUID and enforces platform restrictions (iOS/iPadOS only).

This enables:

Details

  • Adds AuthenticateDeviceByCertificate() to validate certificate serial against host_identity_scep_certificates table
  • Extends device endpoint middleware to route based on presence of X-Client-Cert-Serial header
  • Creates certserial context package following Fleet's existing patterns
  • Adds AuthnDeviceCertificate authentication method to authz package
  • Maintains backward compatibility with token-based auth for other hosts

Testing

  • Unit tests covering success and error cases
  • Integration test scenarios including iOS, iPadOS, and backward compatibility
  • Verified certificate CN validation and platform enforcement
  • Tested multiple device endpoints with certificate auth

@codecov

codecov Bot commented Oct 30, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.58824% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 62.53%. Comparing base (93bea64) to head (4826aeb).
⚠️ Report is 9 commits behind head on feat-32247-ios-ipados-self-service.

Files with missing lines Patch % Lines
server/service/devices.go 93.33% 1 Missing and 1 partial ⚠️
server/service/mdm.go 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@                          Coverage Diff                           @@
##           feat-32247-ios-ipados-self-service   #35009      +/-   ##
======================================================================
- Coverage                               66.21%   62.53%   -3.69%     
======================================================================
  Files                                    2073     2074       +1     
  Lines                                  174776   174827      +51     
  Branches                                 7095     7095              
======================================================================
- Hits                                   115732   109326    -6406     
- Misses                                  48411    55450    +7039     
+ Partials                                10633    10051     -582     
Flag Coverage Δ
backend 63.66% <95.58%> (-4.21%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cdcme
cdcme marked this pull request as ready for review October 30, 2025 20:14
@cdcme
cdcme requested a review from a team as a code owner October 30, 2025 20:14
@cdcme
cdcme changed the base branch from main to feat-32247-ios-ipados-self-service October 30, 2025 21:13

@mna mna left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice! Left some questions for minor stuff, but that was a joy to read and easy to follow.

Comment thread server/service/devices.go
Comment thread server/service/endpoint_middleware.go
Comment thread server/service/endpoint_middleware.go Outdated
Comment thread server/service/endpoint_middleware.go Outdated
Comment thread server/service/devices.go
@cdcme cdcme linked an issue Nov 4, 2025 that may be closed by this pull request
6 tasks

@mna mna left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving as I think you want to follow-up in another PR.

@jkatz01

jkatz01 commented Nov 4, 2025

Copy link
Copy Markdown
Member

Note: It's fine that TestIntegrationsMDM/TestVPPAppInstallVerification is failing for now on this branch, I will fix that once this PR is merged.

@cdcme
cdcme merged commit b0917ba into feat-32247-ios-ipados-self-service Nov 4, 2025
54 of 60 checks passed
@cdcme
cdcme deleted the feat-34258-my-device-webclip-profiles branch November 4, 2025 17:26
cdcme added a commit that referenced this pull request Nov 7, 2025
Implements #32247. This is the complete feature branch, consolidating:

- #35018
- #34758
- #35009
- #35181
- #35342

---------

Co-authored-by: Jonathan Katz <44128041+jkatz01@users.noreply.github.com>
Co-authored-by: RachelElysia <71795832+RachelElysia@users.noreply.github.com>
Co-authored-by: Martin Angers <martin.n.angers@gmail.com>
Co-authored-by: jkatz01 <yehonatankatz@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable My Device page access for iOS and iPadOS via WebClip profile

3 participants