Commit graph

4284 commits

Author SHA1 Message Date
Scott Gress
e13c87cede
gate orbit enrollment to windows/linux only (#38207)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #38205 

# Checklist for submitter

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

- [X] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.

## Testing

- [ ] Added/updated automated tests
- [X] QA'd all new/changed functionality manually
Tested with linux, windows and macos devices. Linux and Windows still
required end-user auth to happen before enrolling, macOS still did not
(but not longer showed the warning).
2026-01-14 08:41:50 -06:00
Martin Angers
f60d081389
Bugfix: Fix query to ignore host_software_installs rows where host is deleted (#38250) 2026-01-14 08:32:30 -05:00
Lucas Manuel Rodriguez
ad31353efe
Update osquery schema and flags to 5.21.0 (#38248) 2026-01-14 09:29:45 -03:00
Magnus Jensen
316adb4cd0
randomize APNS query (#38222)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #36644 

Randomizes the query so we get a new set of 500 every time, and also
improves the index by adding a priority where clause.

It should fine handle up towards 10.000 filtered entries before becoming
slow, and at most we have seen 2k with a customer.

# Checklist for submitter

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

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.

## Testing

- [x] Added/updated automated tests
- [x] QA'd all new/changed functionality manually
2026-01-13 13:06:33 -05:00
Jonathan Katz
7128170674
Fix failed software installs showing for hosts in teams without the installer for those attempts (#38238)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #31569
Makes ListHostSoftware filter software installers by the team id to
avoid listing failed installs for an installer that is no longer scoped
to the host's team.

# Checklist for submitter

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

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.

## Testing

- [x] Added/updated automated tests
- [ ] Where appropriate, [automated tests simulate multiple hosts and
test for host
isolation](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/reference/patterns-backend.md#unit-testing)
(updates to one hosts's records do not affect another)

- [x] QA'd all new/changed functionality manually
2026-01-13 12:52:50 -05:00
Lucas Manuel Rodriguez
7f7e23442c
Trim spaces in VPP app versions (#38236)
See https://fleetdm.slack.com/archives/C086V2QK76X/p1768312364184939.

Related to #38218.
2026-01-13 13:59:48 -03:00
Martin Angers
915408c2a8
IPA: validate conflicts with other installers, return proper error (#38005)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #36621

# Checklist for submitter

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.

- [x] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)

## Testing

- [x] Added/updated automated tests
- [x] Where appropriate, [automated tests simulate multiple hosts and
test for host
isolation](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/reference/patterns-backend.md#unit-testing)
(updates to one hosts's records do not affect another)

- [x] QA'd all new/changed functionality manually
See
https://github.com/fleetdm/fleet/issues/36621#issuecomment-3740340604

---------

Co-authored-by: Jonathan Katz <44128041+jkatz01@users.noreply.github.com>
Co-authored-by: Carlo DiCelico <carlo@fleetdm.com>
2026-01-13 10:30:03 -05:00
Lucas Manuel Rodriguez
b910e7f7b4
Fix repeated installs when end-user is using the application being updated (#38217)
Resolves #38159.

Integration tests will be added in #Integrations #38111.

---------

Co-authored-by: Nico <32375741+nulmete@users.noreply.github.com>
2026-01-13 10:53:40 -03:00
Konstantin Sykulev
c6746e5967
Automatic retry of failed policy automations of scripts and software installs (#38018)
**Related issue:** Resolves #31916

# Checklist for submitter

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

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.
- [x] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)

## Testing

- [x] Added/updated automated tests
- [x] Where appropriate, [automated tests simulate multiple hosts and
test for host
isolation](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/reference/patterns-backend.md#unit-testing)
(updates to one hosts's records do not affect another)
- [x] QA'd all new/changed functionality manually

## Database migrations

- [x] Checked schema for all modified table for columns that will
auto-update timestamps during migration.
- [x] Confirmed that updating the timestamps is acceptable, and will not
cause unwanted side effects.
- [x] Ensured the correct collation is explicitly set for character
columns (`COLLATE utf8mb4_unicode_ci`).

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Script and software installer policy automations now automatically
retry up to three times on failure.
* Retry attempt counters automatically reset when policies transition
from failing to passing state.
* Enhanced attempt tracking for improved monitoring and troubleshooting
of policy automation executions.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-01-12 17:30:51 -06:00
Jordan Montgomery
e225ef5791
Improve Microsoft endpoint validation (#38180)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #13698

# Checklist for submitter

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

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.

- [x] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)
- [x] If paths of existing endpoints are modified without backwards
compatibility, checked the frontend/CLI for any necessary changes

## Testing

- [x] Added/updated automated tests
- [x] Where appropriate, [automated tests simulate multiple hosts and
test for host
isolation](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/reference/patterns-backend.md#unit-testing)
(updates to one hosts's records do not affect another)

- [x] QA'd all new/changed functionality manually
2026-01-12 15:28:45 -05:00
Scott Gress
02f3bb65e0
Add debug logs when attempting to link host to SCIM user (#38183)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** For #37271

# Details

Even after patching and verifying #37271 we're still seeing a case of a
host not being successfully paired with the correct SCIM user after
enrolling. Deleting and re-enrolling the host did not fix the issue. See
recent posts in
https://fleetdm.slack.com/archives/C019WG4GH0A/p1765376152824949 for
details.

This PR adds logging to attempt to diagnose the exact issue.

# Checklist for submitter

## Testing

- [X] QA'd all new/changed functionality manually
Enrolled a host locally and saw logs in various scenarios.
2026-01-12 12:12:17 -06:00
Scott Gress
3907243881
Rename auto-update keys (#38100)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** For #33391

## Testing

- [X] Added/updated automated tests
there's a number of tests for this, if they still pass we're in good
shape
- [X] QA'd all new/changed functionality manually
I tested the front-end successfully, and saw an auto-update go through
on an ipad. Also verified that the activity metadata is correct.
2026-01-12 11:08:26 -06:00
Ian Littman
212e1ee338
Revise auth requirements for debug endpoints (#38173)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #

# Checklist for submitter

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

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.

- [x] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)

## Testing

- [x] Added/updated automated tests

- [x] QA'd all new/changed functionality manually
2026-01-12 10:37:06 -06:00
Martin Angers
c3bee53338
Fix list applications managed and non-managed command uuid (#38162) 2026-01-12 10:03:01 -05:00
Ian Littman
0e6c790803
Add additional validation to mdmMicrosoftAuthEndpoint (#38147)
- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.

- [x] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)

## Testing

- [x] Added/updated automated tests

- [ ] QA'd all new/changed functionality manually
2026-01-10 20:04:27 -06:00
Victor Lyuboslavsky
3cf50f83ab
Searching software versions by name will now return all versions that match the corresponding title name as well (#38103) 2026-01-09 17:02:33 -06:00
Victor Lyuboslavsky
cb3f6184c9
Added validation for empty certificate subject name. (#38114)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #38109 

# Checklist for submitter

## Testing

- [x] Added/updated automated tests
- [x] QA'd all new/changed functionality manually



<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* Improved validation to reject certificate templates with empty or
whitespace-only subject names and provide clearer error messaging when
the certificate template subject name is required.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-01-09 13:45:35 -06:00
Scott Gress
606487ee19
Re-add software auto-update activity updates (#38105)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** For #37926

# Checklist for submitter

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

## Testing

- [ ] Added/updated automated tests
this will be tested by upcoming integration tests for the software
auto-update feature

- [X] QA'd all new/changed functionality manually
I triggered an auto-update on my iPad and saw the correct activity (note
"Fleet" shown as the actor):
<img width="497" height="83" alt="image"
src="https://github.com/user-attachments/assets/09740b84-1b03-4395-baf9-4e1404be6cf1"
/>


For unreleased bug fixes in a release candidate, one of:

- [X] Confirmed that the fix is not expected to adversely impact load
test results
2026-01-09 13:00:06 -06:00
Magnus Jensen
10a2f09f3a
VPP app install retry on 9610 (#38008)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #36724 

This PR updates the VPP Software installation (Apple association) to use
the V1 API which is non-async.
It also retries VPP apps if we receive a 9610 error 3 times.

# Checklist for submitter

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

- [ ] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.

## Testing

- [x] Added/updated automated tests
- [ ] QA'd all new/changed functionality manually

---------

Co-authored-by: Jordan Montgomery <elijah.jordan.montgomery@gmail.com>
2026-01-09 13:39:10 -05:00
Nico
227bcdf46f
GitOps support for scheduled auto updates settings (#37851)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #35457

# Checklist for submitter

- [ ] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.

- [ ] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)
- [ ] If paths of existing endpoints are modified without backwards
compatibility, checked the frontend/CLI for any necessary changes

## Testing

- [x] Added/updated automated tests
- [ ] Where appropriate, [automated tests simulate multiple hosts and
test for host
isolation](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/reference/patterns-backend.md#unit-testing)
(updates to one hosts's records do not affect another)

- [x] QA'd all new/changed functionality manually

### `fleetctl generate-gitops`

**UI**

<img width="1866" height="787" alt="Screenshot 2026-01-07 at 1 14 45 PM"
src="https://github.com/user-attachments/assets/ccb585ee-3074-4ebf-9aaf-6dbdb885cf89"
/>

**Generated YAML**

<img width="694" height="354" alt="Screenshot 2026-01-07 at 1 15 23 PM"
src="https://github.com/user-attachments/assets/3867b63d-265d-43bc-bd60-31fb14e83409"
/>

### `fleetctl gitops`

**Source YAML**

I set the start_time to 18:30 and end_time to 19:30 for the first app

<img width="359" height="354" alt="Screenshot 2026-01-07 at 1 18 33 PM"
src="https://github.com/user-attachments/assets/4cde31e3-aa93-4b75-b296-cc101f507c2a"
/>


After the command ran, verified both on the UI and DB that the new
values were set

<img width="790" height="185" alt="Screenshot 2026-01-07 at 1 18 56 PM"
src="https://github.com/user-attachments/assets/30d9806c-b26c-4f17-b505-facb7fd0df15"
/>

<img width="1432" height="708" alt="Screenshot 2026-01-07 at 1 19 15 PM"
src="https://github.com/user-attachments/assets/5e123f94-ea69-4403-bba3-abf917cc1a01"
/>


## New Fleet configuration settings

- [ ] Setting(s) is/are explicitly excluded from GitOps

If you didn't check the box above, follow this checklist for
GitOps-enabled settings:

- [x] Verified that the setting is exported via `fleetctl
generate-gitops`
- [x] Verified the setting is documented in a separate PR to [the GitOps
documentation](https://github.com/fleetdm/fleet/blob/main/docs/Configuration/yaml-files.md#L485):
a79ff22d84/docs/Configuration/yaml-files.md (L538-L540)
- [x] Verified that the setting is cleared on the server if it is not
supplied in a YAML file (or that it is documented as being optional)
- [ ] Verified that any relevant UI is disabled when GitOps mode is
enabled

## fleetd/orbit/Fleet Desktop

- [ ] Verified compatibility with the latest released version of Fleet
(see [Must
rule](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/workflows/fleetd-development-and-release-strategy.md))
- [ ] If the change applies to only one platform, confirmed that
`runtime.GOOS` is used as needed to isolate changes
- [ ] Verified that fleetd runs on macOS, Linux and Windows
- [ ] Verified auto-update works from the released version of component
to the new version (see [tools/tuf/test](../tools/tuf/test/README.md))
2026-01-09 12:17:03 -03:00
Ian Littman
799a9fd261
Fix expected server address param name for VPP proxy auth (#38062)
For #32461 to sync server and proxy APIs.
2026-01-08 17:46:06 -06:00
Ian Littman
8a1a5988b1
Fix duplicate label check behavior on spec apply endpoint (#38056)
## Testing

- [x] Added/updated automated tests

For unreleased bug fixes in a release candidate, one of:

- [x] Confirmed that the fix is not expected to adversely impact load
test results
2026-01-08 16:18:47 -06:00
Jahziel Villasana-Espinoza
9f29fd1ce9
33509 feature branch (#38038)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #33509

All changes were approved in PRs to this feature branch.

---------

Co-authored-by: RachelElysia <71795832+RachelElysia@users.noreply.github.com>
Co-authored-by: Ian Littman <iansltx@gmail.com>
Co-authored-by: jacobshandling <61553566+jacobshandling@users.noreply.github.com>
Co-authored-by: George Karr <georgekarrv@users.noreply.github.com>
2026-01-08 16:37:46 -05:00
Tim Lee
65adddb000
Renew android certificates backend (#37959) 2026-01-08 13:02:33 -07:00
Zach Wasserman
fac84e5e9b
Use empty values in software last_opened_at when not supported (#38007)
**Related issue:** Resolves #33512 

# Checklist for submitter

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

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.

## Testing

- [x] Added/updated automated tests

- [x] QA'd all new/changed functionality manually
2026-01-08 11:36:06 -08:00
Victor Lyuboslavsky
506901443d
Moved common_mysql package to server/platform/mysql (#38017)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #37244

# Checklist for submitter

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

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.

## Testing

- [x] QA'd all new/changed functionality manually



<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Refactor**
* Internal MySQL utility package reorganized and all internal imports
updated to the new platform location; no changes to end-user
functionality or behavior.

* **Documentation**
* Added platform package documentation describing infrastructure
responsibilities and architectural boundaries to guide maintainers.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-01-08 13:17:19 -06:00
Ian Littman
b1915800e2
Add custom VPP app support (#37969)
Resolves #32481 for Fleet server-side work.

# Checklist for submitter

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

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.

- [x] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)

## Testing

- [x] Added/updated automated tests

- [x] QA'd all new/changed functionality manually
2026-01-08 13:13:04 -06:00
Scott Gress
35d9f42599
Add shared software update schedule validation logic (#38016)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** For #33391 

# Details

This PR adds a shared method for validating a software auto-update
configuration, and updates the datastore and API handler methods to use
it.

# Checklist for submitter

## Testing

- [X] Added/updated automated tests
- [X] QA'd all new/changed functionality manually

Tested in the UI (to ensure valid calls still work) and via API calls
(to test validation)
2026-01-08 10:24:09 -06:00
Gabriel Hernandez
c7c0ee34da
Improved error message when trying to apply CAs via gitops without a premium license (#37981)
**Related issue:** Resolves #35645

This changes the error message for an invalid license when trying to
apply certificate authorities via GitOps

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
- [ ] Added/updated automated tests
- [x] QA'd all new/changed functionality manually
2026-01-08 11:07:38 +00:00
Victor Lyuboslavsky
bc0c7f1d13
Refactor common_mysql (#37245)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #37244

Goal: Make common_mysql package independent of domain packages so it can
be reused by future bounded contexts.

  Changes made:

  1. List options decoupling

The AppendListOptionsToSQL functions previously required
fleet.ListOptions directly. Now common_mysql defines its own interface
that describes what a list options type must provide (page number,
per-page limit, sort order, etc.). The fleet.ListOptions type implements
this interface through new getter methods. This lets any bounded context
use the SQL helpers without importing the fleet package.

  2. Error types moved

Database-specific error types like IsDuplicate and
IsChildForeignKeyError were moved from fleet package to common_mysql
where they belong. A new http/errors.go file was created for the
HTTP-specific error helpers that remain in the platform layer.

  3. Configuration restructuring

MySQL configuration types and functions were moved to
common_mysql/config.go, reducing coupling between packages.

  4. Architecture tests added

A new arch_test.go file enforces that common_mysql doesn't import domain
packages like fleet, preventing future regressions.

# Checklist for submitter

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

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.

## Testing

- [x] Added/updated automated tests
- [x] QA'd all new/changed functionality manually

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Added cursor-based pagination support for list queries with improved
sorting capabilities including secondary order keys.

* **Bug Fixes**
* Improved database connection initialization with separate connection
management and error handling.

* **Refactor**
* Consolidated error handling interfaces and decoupled configuration
structures for better modularity.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-01-07 16:26:44 -06:00
Jordan Montgomery
4fefd97160
Change parameter name from populate_device_status to include_device_status per doc PR review (#37996)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #36094 

Followup work for #36094 after doc PR review

# Checklist for submitter

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

- [x] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)
- [x] If paths of existing endpoints are modified without backwards
compatibility, checked the frontend/CLI for any necessary changes

## Testing

- [x] Added/updated automated tests

- [x] QA'd all new/changed functionality manually
2026-01-07 16:57:57 -05:00
Victor Lyuboslavsky
458c31b81f
Re-timestamp migrations due to 4.79 cherry pick. (#37993)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #30876
2026-01-07 12:20:00 -06:00
Nico
a9e6a0f372
Fix nats_test.go flaky tests (#37976)
Context:
https://fleetdm.slack.com/archives/C019WG4GH0A/p1767759920870649

Looks like some of the tests in `nats_test.go` are failing due to
timeouts. The timeout used for the context in these tests is 5 seconds.
Instead of increasing it, I decided to reduce the number of logs that
are written in tests as well as some sleep statements that I don't think
are needed.
Note that in `nats.go` we use `context.WithTimeout` so that's why the
context deadline exceeded error is raised.

<img width="747" height="373" alt="Screenshot 2026-01-07 at 9 38 04 AM"
src="https://github.com/user-attachments/assets/1a817e8b-6a4a-4d43-9891-07f2791b82ea"
/>

## Testing

Did 5 test runs and measured the test completion time

### Before

<img width="1211" height="230" alt="Screenshot 2026-01-07 at 9 39 59 AM"
src="https://github.com/user-attachments/assets/cf22397b-1962-439c-831f-ef9cde6bf590"
/>

Completion time (avg): 1.23s

### After

<img width="922" height="227" alt="Screenshot 2026-01-07 at 9 38 53 AM"
src="https://github.com/user-attachments/assets/12e1bddd-a257-4313-ab89-e1339374796c"
/>

Completion time (avg): 0.31s
2026-01-07 14:08:42 -03:00
Victor Lyuboslavsky
8ab072f600
Fix CI: extend grace periods for MSRC feeds and expand test coverage for file validation. (#37991)
1. Root cause: cmd/msrc/generate.go

Problem: The MSRC feed generator panicked when the January 2026 feed
wasn't available. The grace period was only 5 days, but MSRC feed
publication dates vary (not available right now).

  Fix: Extended grace period from 5 to 15 days.

2. Defensive fix:
server/vulnerabilities/macoffice/integration_sync_test.go

Problem: Test only checked for files from the last 2 days, which failed
when the NVD repo hadn't published for a few days.

  Fix: Extended tolerance to 7 days.
2026-01-07 10:28:20 -06:00
Lucas Manuel Rodriguez
fb785ce9ce
Check host teams before adding them to team manual labels (#37975)
**Related issue:** #33760

## Testing

- [X] Added/updated automated tests
- [X] QA'd all new/changed functionality manually

For unreleased bug fixes in a release candidate, one of:

- [X] Confirmed that the fix is not expected to adversely impact load
test results
2026-01-07 13:13:25 -03:00
Scott Gress
4a2462605a
Update "installed app store app" activity to account for auto-updates (#37940)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #37926 

# Details

This PR updates the `ActivityInstalledAppStoreApp` activity and the code
that generates it so that if a VPP install is triggered by a software
title's auto-update config, `fleet_initiated` is set to `1` in the
activity record. This is needed for auditing purposes in general, and
for accurate display of the activity in the Fleet UI in particular.

# Checklist for submitter

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

- [X] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)

## Testing

- [ ] Added/updated automated tests
@lucasmrod is adding integration tests for this flow, we can check the
"last activity" from there and verify that `fleet_initiated=1`.

- [X] QA'd all new/changed functionality manually
Before:

<img width="718" height="138" alt="image"
src="https://github.com/user-attachments/assets/94489c20-a655-48ba-8284-21be02e8123c"
/>

After:

<img width="433" height="71" alt="image"
src="https://github.com/user-attachments/assets/9c4360d5-fc1b-41fd-9fd2-45211cea940d"
/>

Also verified that manual installs and re-installs still work as
expected and have `fleet_intiated=0`.

---------

Co-authored-by: Lucas Manuel Rodriguez <lucas@fleetdm.com>
2026-01-07 09:36:33 -06:00
Victor Lyuboslavsky
9bf27893a6
Point to com.fleetdm.agent Android agent by default. (#37770)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #37736

Enabling the public Android agent for Android MDM, by default
- `com.fleetdm.agent`

Also bug fix: [Preserve Fleet Agent in Android policy during GitOps/API
app
updates.](9b3ccf55dc)

# Checklist for submitter

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

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.


## Testing

- [x] Added/updated automated tests
- [x] QA'd all new/changed functionality manually

For unreleased bug fixes in a release candidate, one of:

- [x] Confirmed that the fix is not expected to adversely impact load
test results




<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

## Release Notes

* **New Features**
* Added Android agent application with automatic deployment via Android
MDM to support SCEP certificate management on Android devices.
* Introduced configurable Android agent settings for package name and
signing certificate.

* **Documentation**
* Updated Android MDM configuration documentation with environment
variable and YAML configuration examples for Android agent deployment.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-01-06 18:11:23 -06:00
Juan Fernandez
b2df8596bc
gitops changes for team labels (#37801)
**Related issue:** Resolves #36759

Allow users to manage team labels via gitops.
2026-01-06 17:47:30 -04:00
Victor Lyuboslavsky
3d2171d2d9
Moved common endpointer packages to platform dir. (#37780)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #37192

- Move /server/service/middleware/endpoint_utils to
/server/platform/endpointer
- Move /server/service/middleware/authzcheck to
/server/platform/middleware/authzcheck
- Move /server/service/middleware/ratelimit to
/server/platform/middleware/ratelimit

# Checklist for submitter

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.

## Testing

- [x] Added/updated automated tests
- [x] QA'd all new/changed functionality manually


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

## Release Notes

* **Refactor**
* Reorganized internal endpoint utilities to a centralized platform
location for improved code organization and maintainability. No
functional changes to existing features or APIs.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-01-06 14:23:07 -06:00
Nico
116c8ddb4f
Remove valyala/fastjson and valyala/fasttemplate dependencies (#37914)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
Context:
https://fleetdm.slack.com/archives/C019WG4GH0A/p1767713469571139

Replaced `valyala` dependencies and now relying on `json.Unmarshal` and
manual traversal of `Template` subjects, such as [this
one](https://github.com/fleetdm/fleet/blob/main/server/logging/nats_test.go#L113)

# Checklist for submitter

## Testing

- [x] ~~Added/updated automated tests~~ I'm relying on existing tests on
`nats_test.go` which already cover using a `Template` subject, namely:


https://github.com/fleetdm/fleet/blob/main/server/logging/nats_test.go#L112-L132

https://github.com/fleetdm/fleet/blob/main/server/logging/nats_test.go#L194-L245

https://github.com/fleetdm/fleet/blob/main/server/logging/nats_test.go#L301-L356

- [ ] Where appropriate, [automated tests simulate multiple hosts and
test for host
isolation](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/reference/patterns-backend.md#unit-testing)
(updates to one hosts's records do not affect another)

- [x] QA'd all new/changed functionality manually

Ran `nats-server`, subscribed to all subjects by running `nats
--server=nats://localhost:4222 subscribe ">"` and got logs from this
query:

<img width="675" height="411" alt="Screenshot 2026-01-06 at 4 12 52 PM"
src="https://github.com/user-attachments/assets/e4e6e5d0-53ac-4b09-9810-b6032794d5f3"
/>



<img width="773" height="165" alt="Screenshot 2026-01-06 at 4 11 16 PM"
src="https://github.com/user-attachments/assets/6f58d1f1-272b-40b3-96f5-1659c0bbb918"
/>
<img width="2541" height="119" alt="Screenshot 2026-01-06 at 4 11 06 PM"
src="https://github.com/user-attachments/assets/2e61acac-063c-4cdd-aeee-871031600125"
/>
2026-01-06 16:58:51 -03:00
Lucas Manuel Rodriguez
6aa7a3da08
Add scheduled updates functionality to iOS/iPadOS managed devices (#37704)
Resolves #35455

- [X] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.

- [X] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)

## Testing

- [ ] Added/updated automated tests
- [x] QA'd all new/changed functionality manually

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Introduced scheduled software updates for iOS/iPadOS managed devices
with time-window based installation scheduling that considers device
timezone
* Added timezone tracking for managed iOS/iPadOS hosts to enable
timezone-aware update scheduling

* **Improvements**
* Enhanced software update scheduling system with timezone and
time-window awareness for eligible devices

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Scott Gress <scottmgress@gmail.com>
2026-01-06 16:04:06 -03:00
Scott Gress
e35684268d
Add auto-update schedule to software activity updates (#37715)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #35458

# Details

This PR adds new metadata to the `ActivityEditedAppStoreApp` activity
relating to the app's auto-update schedule. The data will be included
with every `ActivityEditedAppStoreApp` activity regardless of whether
the values changed. I have an open question about this on the [activity
docs
PR](https://github.com/fleetdm/fleet/pull/36534/changes#r2648884183).

One functional change to note here is that the act of recording the
activity has been moved up a level into the endpoint code, because the
activity now contains metadata from two different service methods (one
that updates the VPP app, and one that creates the auto-update
schedule).

# Checklist for submitter

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

- [X] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.

## Testing

- [X] Added/updated automated tests
- [X] QA'd all new/changed functionality manually
2026-01-06 10:52:26 -06:00
Sarah Gillespie
cf3daa3d5b
Update error message for Apple profile scope conflict across teams (#37559) 2026-01-06 10:36:30 -06:00
Victor Lyuboslavsky
af1e150a2b
Deleting/adding Android certs to host on team transfer (#37616)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #37580 

Resolves unreleased 4.79 bug and needs to be cherry picked. Also
includes fixes from manually going through the test plan at:
[#30876](https://github.com/fleetdm/fleet/issues/30876)

# Checklist for submitter

## Testing

- [x] Added/updated automated tests
- [x] QA'd all new/changed functionality manually

For unreleased bug fixes in a release candidate, one of:

- [x] Confirmed that the fix is not expected to adversely impact load
test results

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Release Notes

* **New Features**
* Per-template versioning and explicit operation/status fields for host
certificate templates; delivery payloads now include per-template
details.

* **Bug Fixes**
* Removal preparation broadened to also clear failed entries and handle
per-host removals; delivery/transition ordering adjusted to avoid race
conditions.

* **Tests**
* Extensive tests added for team-transfer flows, per-host
removal/preparation, and end-to-end Android certificate template
scenarios.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-01-06 10:20:07 -06:00
Martin Angers
b00efa944d
iBYOD Apps: only ingest and report Fleet-managed apps for manual-enrolled iOS/iPadOS (#37856) 2026-01-06 10:50:47 -05:00
Eric Busto
b6d19de0d9
Add support for publishing logs to NATS. (#36527)
**Related issue:** Resolves
[34890](https://github.com/fleetdm/fleet/issues/34890)

# Checklist for submitter
- [X] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.

## Testing
- [X] Added/updated automated tests
- [X] QA'd all new/changed functionality manually

## New Fleet configuration settings
Looking at other log destinations, I couldn't find anything relevant in
GitOps. Please let me know if I missed something, however.

## fleetd/orbit/Fleet Desktop
I've tested this on both Linux and MacOS.

---------

Co-authored-by: Rachael Shaw <r@rachael.wtf>
Co-authored-by: nulmete <nicoulmete1@gmail.com>
2026-01-06 09:10:32 -03:00
Jonathan Katz
fc4106c688
Cloudfront signing for in-house apps (#37650)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #33756

# Checklist for submitter

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

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.

## Testing

- [x] Added/updated automated tests
- [ ] Where appropriate, [automated tests simulate multiple hosts and
test for host
isolation](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/reference/patterns-backend.md#unit-testing)
(updates to one hosts's records do not affect another)

- [x] QA'd all new/changed functionality manually
2026-01-05 16:30:31 -05:00
Ian Littman
b96d250ecc
Fix missing upgrade codes when Windows FMAs are uploaded via GitOps (#37862)
Relates to #37771.

No changes file as the #37772 changes file covers this.

- [x] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)

## Testing

- [x] Added/updated automated tests
- [x] QA'd all new/changed functionality manually
2026-01-05 13:44:58 -06:00
Victor Lyuboslavsky
f402ae783f
Fixing upgrade code issues (#37785)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #37494 

Manually verified fixes with osquery-perf.

Fixes:
Issue 1: Duplicate entry error when updating upgrade_code
Issue 2: Case sensitivity mismatch causes duplicate titles

# Checklist for submitter

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

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.

## Testing

- [x] Added/updated automated tests
- [x] QA'd all new/changed functionality manually



<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

## Release Notes

* **Bug Fixes**
* Improved software title matching to be case-insensitive, preventing
duplicate entries for the same software reported with different
capitalization.
* Enhanced upgrade code reconciliation logic to properly detect and
handle conflicts when multiple software entries share upgrade codes.

* **Tests**
* Added test coverage for case-insensitive software title matching and
upgrade code reconciliation scenarios.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-01-05 13:08:29 -06:00
Josh Roskos
5bf82e2935
Add device_status and action_pending to /hosts API (#36009)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #36315 


## Testing

- [X] Added/updated automated tests
- [X] Where appropriate, [automated tests simulate multiple hosts and
test for host
isolation](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/reference/patterns-backend.md#unit-testing)
(updates to one hosts's records do not affect another)
- [ ] QA'd all new/changed functionality manually
- @kc9wwh: No issues with building or enrolling devices. Got it behind
SSL cert and MDM working, but I would need a supervised device to test
further.

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Jordan Montgomery <elijah.jordan.montgomery@gmail.com>
Co-authored-by: Magnus Jensen <magnus@fleetdm.com>
2026-01-05 14:00:42 -05:00