Skip to content

Disallow bypass_conditional_access on iOS/iPadOS - #51555

Open
JordanMontgomery wants to merge 1 commit into
mainfrom
JM-disable-conditional-access-ios-ipados
Open

Disallow bypass_conditional_access on iOS/iPadOS#51555
JordanMontgomery wants to merge 1 commit into
mainfrom
JM-disable-conditional-access-ios-ipados

Conversation

@JordanMontgomery

@JordanMontgomery JordanMontgomery commented Aug 19, 2026

Copy link
Copy Markdown
Member

Related issue: Resolves https://github.com/fleetdm/security/issues/15

Checklist for submitter

If some of the following don't apply, delete the relevant line.

No actual user-facing change as this endpoint was not used by the user-facing iOS/iPadOS self service page

  • Changes file added for user-visible changes in changes/, orbit/changes/ or ee/fleetd-chrome/changes.
    See Changes files for more information.

Testing

  • QA'd all new/changed functionality manually

Summary by CodeRabbit

  • Bug Fixes
    • Device-authenticated requests using the device URL are now correctly denied when conditional-access requirements apply.
    • Authorization context is now respected when evaluating conditional-access bypasses.

@JordanMontgomery

Copy link
Copy Markdown
Member Author

@coderabbitai review

@JordanMontgomery
JordanMontgomery marked this pull request as ready for review August 19, 2026 15:51
@JordanMontgomery
JordanMontgomery requested a review from a team as a code owner August 19, 2026 15:51
@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copilot AI 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.

Pull request overview

This PR aims to prevent iOS/iPadOS devices from using the bypass_conditional_access device endpoint, aligning the enterprise service behavior with the expectation that iOS/iPadOS devices don’t participate in conditional access policies.

Changes:

  • Added an authentication-method check to deny conditional access bypass for device-URL-authenticated requests.
  • Introduced a new import for the authz context authn-method constants.
Suppressed comments (2)

ee/server/service/devices.go:115

  • This blocks bypass only for AuthnDeviceURL, but iOS/iPadOS device self-service can also authenticate via client certificate (AuthnDeviceCertificate). That means iOS/iPadOS could still call this endpoint successfully when certificate-authenticated, which contradicts the intent to disallow bypass on iOS/iPadOS.
	// iOS/iPadOS devices authenticate by UUID in the URL and don't participate in
	// conditional access policies, so they can't bypass it.
	if svc.authz.IsAuthenticatedWith(ctx, authz_ctx.AuthnDeviceURL) {
		return fleet.NewUserMessageError(errors.New("conditional access bypass is not supported on this device"), http.StatusForbidden)
	}

ee/server/service/devices.go:115

  • This change introduces new iOS/iPadOS-specific behavior (403 for bypass) but there doesn’t appear to be test coverage ensuring iOS/iPadOS cannot bypass conditional access. Consider adding an integration test subcase (e.g., in TestConditionalAccessBypass) that creates an iOS/ipados host and asserts this endpoint returns 403.
	// iOS/iPadOS devices authenticate by UUID in the URL and don't participate in
	// conditional access policies, so they can't bypass it.
	if svc.authz.IsAuthenticatedWith(ctx, authz_ctx.AuthnDeviceURL) {
		return fleet.NewUserMessageError(errors.New("conditional access bypass is not supported on this device"), http.StatusForbidden)
	}

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread ee/server/service/devices.go
@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: bc106738-d33d-44db-8fb6-b4578ac8edec

📥 Commits

Reviewing files that changed from the base of the PR and between 95ffbcd and 9a9ff96.

📒 Files selected for processing (1)
  • ee/server/service/devices.go

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


Walkthrough

The service imports authorization-context support. BypassConditionalAccess now rejects device URL-authenticated requests with HTTP 403 before it evaluates configuration or applies the conditional-access bypass.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the main change: blocking conditional-access bypass on iOS and iPadOS.
Description check ✅ Passed The description links the related security issue, explains the user-facing impact, and records manual QA for the changed functionality.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch JM-disable-conditional-access-ios-ipados

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Aug 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.83%. Comparing base (a4ff784) to head (9a9ff96).
⚠️ Report is 188 commits behind head on main.

Files with missing lines Patch % Lines
ee/server/service/devices.go 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #51555      +/-   ##
==========================================
+ Coverage   68.64%   68.83%   +0.19%     
==========================================
  Files        3993     4008      +15     
  Lines      257444   259930    +2486     
  Branches    13647    13647              
==========================================
+ Hits       176724   178926    +2202     
- Misses      65006    65137     +131     
- Partials    15714    15867     +153     
Flag Coverage Δ
backend 69.95% <0.00%> (+0.21%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 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.

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.

2 participants