Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include Linux disk encryption status in configuration profiles aggregate status response when applicable, fix disk encryption/MDM configuration order-of-operations issues, add integration tests for LUKS #24114

Merged
merged 11 commits into from
Nov 25, 2024

Conversation

jacobshandling
Copy link
Contributor

@jacobshandling jacobshandling commented Nov 23, 2024

Addresses #24112, #24116, #23587

For #24112, Counts included:
Screenshot 2024-11-22 at 5 31 06 PM

  • Include counts when disk encryption is enforced
  • Exclude counts when disk encryption isn't enforced
    __
  • Added/updated tests
  • Manual QA for all new/changed functionality

Copy link

codecov bot commented Nov 23, 2024

Codecov Report

Attention: Patch coverage is 11.68831% with 68 lines in your changes missing coverage. Please review.

Project coverage is 54.07%. Comparing base (ee73249) to head (259fcad).
Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
server/service/mdm.go 0.00% 39 Missing ⚠️
server/service/linux_mdm.go 0.00% 19 Missing ⚠️
ee/server/service/teams.go 20.00% 4 Missing ⚠️
server/service/apple_mdm.go 20.00% 4 Missing ⚠️
frontend/services/entities/mdm.ts 0.00% 1 Missing ⚠️
server/datastore/mysql/labels.go 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #24114      +/-   ##
==========================================
- Coverage   63.42%   54.07%   -9.35%     
==========================================
  Files        1579     1579              
  Lines      149948   150098     +150     
  Branches     3818     3818              
==========================================
- Hits        95106    81172   -13934     
- Misses      47261    62208   +14947     
+ Partials     7581     6718     -863     
Flag Coverage Δ
backend 54.10% <11.84%> (-10.20%) ⬇️
frontend 52.55% <0.00%> (ø)

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.


🚨 Try these New Features:

server/fleet/service.go Outdated Show resolved Hide resolved
server/service/linux_mdm.go Outdated Show resolved Hide resolved
@jacobshandling jacobshandling force-pushed the aggregate-status-missing-linux branch from bfc10d1 to d8b51c9 Compare November 23, 2024 01:41
@iansltx iansltx changed the title Aggregate status missing linux Include Linux disk encryption status in configuration profiles aggregate status response when applicable Nov 23, 2024
@iansltx
Copy link
Member

iansltx commented Nov 23, 2024

Merging in my existing integration tests branch here as I need the integration test started there to confirm this is behaving correctly. Will probably expand PR scope for the other config known issue(s).

@iansltx iansltx force-pushed the aggregate-status-missing-linux branch from ad30999 to 1a716f5 Compare November 23, 2024 02:46
@iansltx iansltx marked this pull request as ready for review November 23, 2024 02:51
@iansltx iansltx requested review from a team as code owners November 23, 2024 02:51
…urned on, skip FileVault config when enabling disk encryption when macOS MDM is off

Also ensures disk encryption on a per-team basis works as expected.

TODO: set up FileVault if Mac MDM gets enabled after encryption enforcement is enabled.
…nfigured, set up FileVault escrow at that time
@iansltx iansltx changed the title Include Linux disk encryption status in configuration profiles aggregate status response when applicable Include Linux disk encryption status in configuration profiles aggregate status response when applicable, fix disk encryption/MDM configuration order-of-operations issues Nov 24, 2024
@iansltx iansltx requested a review from mna November 24, 2024 23:55
… to ensure LUKS platform check works on key retrieval
@iansltx iansltx changed the title Include Linux disk encryption status in configuration profiles aggregate status response when applicable, fix disk encryption/MDM configuration order-of-operations issues Include Linux disk encryption status in configuration profiles aggregate status response when applicable, fix disk encryption/MDM configuration order-of-operations issues, add integration tests for LUKS Nov 25, 2024
Copy link
Member

@lucasmrod lucasmrod left a comment

Choose a reason for hiding this comment

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

LGTM!

Left just a small question.

}
}
// Enable FileVault escrow for teams that already have disk encryption enforced
// For later: add a data store method to avoid making an extra query per team to check whether encryption is enforced
Copy link
Member

Choose a reason for hiding this comment

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

I think ListTeams is used in a few places to list all teams along with their config? E.g. here:

teams, err := ds.ListTeams(
ctx, fleet.TeamFilter{
User: &fleet.User{
GlobalRole: ptr.String(fleet.RoleAdmin),
},
}, fleet.ListOptions{},
)

Copy link
Member

Choose a reason for hiding this comment

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

Yep. Considered that but it pulls way more data so it wasn't clear that it was better than an N+1 here, so will leave this as is.

Copy link
Member

@iansltx iansltx left a comment

Choose a reason for hiding this comment

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

My approval specifically covers the FE changes @jacobshandling made (and that I didn't touch), in my capacity as "being able to review FE code"; thx @lucasmrod for the BE approval!

@iansltx
Copy link
Member

iansltx commented Nov 25, 2024

TestIntegrationSync is an unrelated failure, as are the native tooling/Docker publish failures.

@iansltx iansltx merged commit 61a79f5 into main Nov 25, 2024
23 of 27 checks passed
@iansltx iansltx deleted the aggregate-status-missing-linux branch November 25, 2024 14:34
iansltx added a commit that referenced this pull request Nov 25, 2024
…ate status response when applicable, fix disk encryption/MDM configuration order-of-operations issues, add integration tests for LUKS (#24114)

## Addresses #24112, #24116, #23587

**For #24112, Counts included:**
<img width="1392" alt="Screenshot 2024-11-22 at 5 31 06 PM"
src="https://github.com/user-attachments/assets/2bb306d7-1130-4106-aef8-475b8be1f6b2">

- [x] Include counts when disk encryption is enforced
- [x] Exclude counts when disk encryption isn't enforced
__
- [x] Added/updated tests

---------

Co-authored-by: Jacob Shandling <[email protected]>
Co-authored-by: Ian Littman <[email protected]>
iansltx added a commit that referenced this pull request Nov 25, 2024
…ofiles aggregate status response when applicable, fix disk encryption/MDM configuration order-of-operations issues, add integration tests for LUKS (#24124)

Cherry-pick of #24114, for #24112, #24116, #23587

Co-authored-by: jacobshandling <[email protected]>
Co-authored-by: Jacob Shandling <[email protected]>
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.

5 participants