Commit graph

3334 commits

Author SHA1 Message Date
Victor Lyuboslavsky
131a52695b
Custom SCEP integration (#27121)
For #26623 

This PR enables deploying an Apple configuration profile with Fleet
proxying a custom SCEP server.

# Checklist for submitter

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
- [x] If database migrations are included, checked table schema to
confirm autoupdate
- For 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`).
- [x] Added/updated automated tests
- [x] A detailed QA plan exists on the associated ticket (if it isn't
there, work with the product group's QA engineer to add it)
- [x] Manual QA for all new/changed functionality
2025-03-17 10:59:07 -05:00
Ian Littman
fdff6e16ca
Revise FMA list endpoint to match Windows FMA spec (#27180)
For #26652. No changes file as that'll come in another PR. Will stack
additional PRs on top of this one (for ingestion changes etc.) to get
this merged more quickly.

# Checklist for submitter

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

<!-- Note that API documentation changes are now addressed by the
product design team. -->

- [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
- [x] Added/updated automated tests
- [x] A detailed QA plan exists on the associated ticket (if it isn't
there, work with the product group's QA engineer to add it)
- [x] Manual QA for all new/changed functionality
2025-03-17 10:09:39 -05:00
RachelElysia
0c77e61cfa
Rest API: Add platform to endpoints with software packages and vpp apps (#27124) 2025-03-17 09:59:03 -04:00
Jahziel Villasana-Espinoza
d0f70c5980
fix: report a failure in setup experience if a VPP app installation fails due to lack of licenses (#27163)
> For #26345

# Checklist for submitter

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

<!-- Note that API documentation changes are now addressed by the
product design team. -->

- [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/Committing-Changes.md#changes-files)
for more information.
- [x] Added/updated automated tests
- [x] A detailed QA plan exists on the associated ticket (if it isn't
there, work with the product group's QA engineer to add it)
- [x] Manual QA for all new/changed functionality
2025-03-17 09:43:51 -04:00
Dan Tsekhanskiy
f63afc8253
Ignore comments at the top of XML files (#27176)
Allows comments to be at the top of Fleet XML CSP files (addresses
https://github.com/fleetdm/fleet/issues/26443)

We should validate that this fixes the errors with GitOps pushes, but I
don't know how to do that without pushing this change through to QA.

# Checklist for submitter

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

<!-- Note that API documentation changes are now addressed by the
product design team. -->

- [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/Committing-Changes.md#changes-files)
for more information.
- [x] Added/updated automated tests
- [x] Manual QA for all new/changed functionality
2025-03-15 10:40:50 -05:00
Victor Lyuboslavsky
84d35dc0cd
Add custom SCEP configs (#27045)
For #26603 

This PR includes:
- Refactoring of NDES/SCEP verify/timeout logic for easier testing (with
dependency injection)
- Custom SCEP configs
- saving/deleting/updating of encrypted custom SCEP challenges
- validation call to custom SCEP server to verify connection
- Custom SCEP activities
- unit and integration tests for all of the above

This PR does not include the following:
- Changes file (in later PR)

# Checklist for submitter

- [x] Added/updated automated tests
- [x] Manual QA for all new/changed functionality
2025-03-14 12:16:51 -05:00
Ian Littman
0a43baf9ce
Add comment explaining why we aren't using VERSION_COMPARE() in discovery queries (#27142)
For #27126.
2025-03-14 10:19:18 -05:00
Ian Littman
1537eb710f
Revise discovery queries for Python software inventory to be compatible with earlier versions of osquery (#27130) 2025-03-13 17:32:06 -06:00
Victor Lyuboslavsky
a86253d2bf
Refactoring Android datastore interface (#26982)
For #26219 

Refactoring the interface between Android service and Android datastore
to use 1 common datastore interface: `fleet.AndroidDatastore`

These changes are based on feedback from the recent Backend Sync.

```mermaid
---
title: Partial class diagram
---
classDiagram
    direction LR
    class `android.Service`
    <<interface>> `android.Service`
    class `android/service.Service`
    `android/service.Service` ..|> `android.Service`: implements

    class `fleet.AndroidDatastore`
    <<interface>> `fleet.AndroidDatastore`
    class `fleet.Datastore`
    <<interface>> `fleet.Datastore`
    class `android.Datastore`
    <<interface>> `android.Datastore`
    `android/service.Service` *-- `fleet.AndroidDatastore`: USES (THIS IS THE KEY CHANGE)
    `fleet.Datastore` *-- `fleet.AndroidDatastore`: contains
    `mysql.Datastore` ..|> `fleet.Datastore`: implements
    `fleet.AndroidDatastore` *-- `android.Datastore`: contains
    `mysql.Datastore` *-- `android.Datastore`: contains
    `android/mysql.Datastore` ..|> `android.Datastore`: implements
```
2025-03-13 14:28:52 -05:00
Victor Lyuboslavsky
de64d1f074
Fixed bug with editing DigiCert config (#27102)
For #26603 

Issue: when editing DigiCert config, we were making a call to DigiCert
when admin modified CN, UPN, or Seat ID.

Fix: when editing these DigiCert fields, API token is required to be
re-entered (for security):
- Name
- URL
- Profile GUID

# Checklist for submitter
- [x] Added/updated automated tests
- [x] Manual QA for all new/changed functionality
2025-03-13 12:16:11 -05:00
Sarah Gillespie
ed12731475
Improve error handling during host certificate ingestion (#27090) 2025-03-13 10:28:31 -05:00
Jahziel Villasana-Espinoza
4e325bb131
FMAv2 ingestion functionality (#27018)
> For #26083

# Checklist for submitter

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

<!-- Note that API documentation changes are now addressed by the
product design team. -->

- [x] Added/updated automated tests
- [x] Manual QA for all new/changed functionality

---------

Co-authored-by: Ian Littman <iansltx@gmail.com>
2025-03-12 17:51:14 -04:00
Konstantin Sykulev
bd2b2bcd3b
validate generate-cve.yml outputs (#26752)
https://github.com/fleetdm/fleet/issues/21300

- [x] Added/updated automated tests
- [x] A detailed QA plan exists on the associated ticket (if it isn't
there, work with the product group's QA engineer to add it)
- [x] Manual QA for all new/changed functionality
2025-03-12 14:49:47 -05:00
Konstantin Sykulev
997adcebe0
Batched getPoliciesBySoftwareTitleIDs (#27062)
Mysql has a max of 65535 placeholders in a sql statement. When > 33k
title ids are passed to `getPoliciesBySoftwareTitleIDs` this causes a
`Prepared statement contains too many placeholders` error. Fixed this by
splitting up the query into multiple queries and aggregating the results
in memory.

https://github.com/fleetdm/fleet/issues/26753

- [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/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] Added/updated automated tests
- [x] A detailed QA plan exists on the associated ticket (if it isn't
there, work with the product group's QA engineer to add it)
- [x] Manual QA for all new/changed functionality
2025-03-12 14:48:52 -05:00
Martin Angers
29b06a61f1
Bugfix: Ignore non-Fleet-MDM-enrolled Windows hosts in disk encryption stats and filters (#27066) 2025-03-12 15:31:23 -04:00
Ian Littman
cc352970c0
Dedupe MSRC downloads/deletes when enrolled hosts include multiple builds of the same version of Windows (#27060)
For #25090.

# Checklist for submitter

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

<!-- Note that API documentation changes are now addressed by the
product design team. -->

- [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/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] Added/updated automated tests
- [x] A detailed QA plan exists on the associated ticket (if it isn't
there, work with the product group's QA engineer to add it)
- [x] Manual QA for all new/changed functionality
2025-03-12 13:22:56 -05:00
Sarah Gillespie
26c5bc72b1
Fix unreleased bug when parsing distinguished name from host certificates (#27070) 2025-03-12 12:18:41 -05:00
Jahziel Villasana-Espinoza
5451cd13d4
pad macOS versions with an extra 0 during CPE generations so that we can match vulncheck versions (#27069)
> For #26561

# Checklist for submitter

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

<!-- Note that API documentation changes are now addressed by the
product design team. -->

- [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/Committing-Changes.md#changes-files)
for more information.
- [x] Added/updated automated tests
- [x] A detailed QA plan exists on the associated ticket (if it isn't
there, work with the product group's QA engineer to add it)
- [x] Manual QA for all new/changed functionality
2025-03-12 13:01:37 -04:00
RachelElysia
dafb0c89f7
Host Software Table: Add vulnerability filters to API and UI (#26995) 2025-03-12 11:26:12 -04:00
Victor Lyuboslavsky
b91e8eb465
Added saving of NotValidAfter (#27030)
For #26609 

This PR adds logic to save NotValidAfter time for DigiCert certificate.
This info will be needed for a follow up certificate renewal story.

# Checklist for submitter

- [x] Added/updated automated tests
- [x] Manual QA for all new/changed functionality
2025-03-11 15:56:25 -05:00
Victor Lyuboslavsky
6ce3a998b7
Adding Fleet vars support for DigiCert. (#27009)
For #26609 

This PR adds support for the following Fleet variables in DigiCert CN,
SeatID, and UPN fields:
- FLEET_VAR_HOST_HARDWARE_SERIAL
- FLEET_VAR_HOST_END_USER_EMAIL_IDP

It also adds support for FLEET_VAR_HOST_HARDWARE_SERIAL in any profile,
similar to FLEET_VAR_HOST_END_USER_EMAIL_IDP

# Checklist for submitter

- [x] Added/updated automated tests
- [x] Manual QA for all new/changed functionality
2025-03-11 13:44:08 -05:00
Martin Angers
c8b1af7603
Android: fix BYOD enrollment page to get up-to-date MDM enabled status (#27011) 2025-03-11 11:06:25 -04:00
Dante Catalfamo
d5e9153cea
Add LabelsIncludeAny to queries endpoint (#26823)
#16413 

---------

Co-authored-by: Scott Gress <scottmgress@gmail.com>
2025-03-11 09:45:01 -04:00
Victor Lyuboslavsky
57ef7b36ac
Added DigiCert UPN support. (#27006)
For #26609

- Added User Principal Name (UPN) support for DigiCert integration. We
currently support only 1 UPN.

# Checklist for submitter

- [x] Added/updated automated tests
- [x] Manual QA for all new/changed functionality
2025-03-10 16:02:23 -05:00
Victor Lyuboslavsky
b42dbf2ff7
DigiCert backend (#26914)
For #26609 

This PR includes
- ability to get a DigiCert certificate to a macOS device
- integration test for the above
- some validation

This PR does not include the following. They will be included in
subsequent PRs:
- support for User Principal Name in certificate
- support for $FLEET_VAR_HOST_HARDWARE_SERIAL
- saving certificate expiration date
- not resending DigiCert profile after failure

# 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/Committing-Changes.md#changes-files)
for more information.
- [x] Added/updated automated tests
- [x] A detailed QA plan exists on the associated ticket (if it isn't
there, work with the product group's QA engineer to add it)
- [x] Manual QA for all new/changed functionality
2025-03-10 13:02:49 -05:00
Dante Catalfamo
b49d131a05
Parse top-level json array when request arrives, before service func (#26665)
#24390
2025-03-10 13:27:17 -04:00
Jahziel Villasana-Espinoza
7c7d9cb30a
add batching logic when we pull windows profiles to install or remove (#26964)
> For #26918

# Checklist for submitter

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

<!-- Note that API documentation changes are now addressed by the
product design team. -->

- [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/Committing-Changes.md#changes-files)
for more information.
- [x] Added/updated automated tests
- [x] A detailed QA plan exists on the associated ticket (if it isn't
there, work with the product group's QA engineer to add it)
- [x] Manual QA for all new/changed functionality

---------

Co-authored-by: Ian Littman <iansltx@gmail.com>
2025-03-10 09:12:24 -05:00
Ian Littman
b2efa09e2b
Add new archive URL as data source for Mac Office release notes (#26978)
For #26977.

# Checklist for submitter

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

<!-- Note that API documentation changes are now addressed by the
product design team. -->

- [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/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] Added/updated automated tests
- [x] A detailed QA plan exists on the associated ticket (if it isn't
there, work with the product group's QA engineer to add it)
- [x] Manual QA for all new/changed functionality
2025-03-10 08:46:18 -05:00
Victor Lyuboslavsky
dc7d1b382f
DigiCert verify profile ID (#26899)
For #26603

This PR completes the #26603 sub-task for configuring DigiCert. It adds:
- validation call to DigiCert to verify the profile ID
- tests/checks for activity feed

The changes file will be added in the next DigiCert subtask.

# Checklist for submitter
- [x] Added/updated automated tests
- [x] Manual QA for all new/changed functionality
2025-03-07 14:55:25 -06:00
Ian Littman
014f10fb46
Add experimental software title name update endpoint for titles with a bundle ID (#26938)
For #26933.

# Checklist for submitter

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

<!-- Note that API documentation changes are now addressed by the
product design team. -->

- [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/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] Added/updated automated tests
- [x] A detailed QA plan exists on the associated ticket (if it isn't
there, work with the product group's QA engineer to add it)
- [x] Manual QA for all new/changed functionality

---------

Co-authored-by: Rachael Shaw <r@rachael.wtf>
2025-03-07 11:36:17 -06:00
Jahziel Villasana-Espinoza
32c5c47b1f
added panic recovery to software mutations flow just to be safe (#26932)
> For #24784

# Checklist for submitter

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

<!-- Note that API documentation changes are now addressed by the
product design team. -->
- [x] Added/updated automated tests
- [x] Manual QA for all new/changed functionality
2025-03-07 10:24:56 -05:00
George Karr
36aba531f4
Revert "Disallow user-scoped profiles for Windows MDM" (#26940)
Reverts fleetdm/fleet#26153
2025-03-07 08:33:40 -06:00
Scott Gress
b95f5ac50c
Don't allow gitops to disable gitops mode (#26794)
For #26743

This PR fixes an issue where using `fleetctl gitops` unsets the "gitops
mode" settings in the UI. The code which prepares the config spec to
send to the "modify config" endpoint deliberately copies over the
current app settings for gitops mode to facilitate this. I updated an
existing test to verify the new behavior.
2025-03-06 16:42:58 -06:00
Victor Lyuboslavsky
9deabe8f70
DigiCert config (encrypt API token) (#26858)
For #26603

This PR includes:

- DB migration for DigiCert
- new datastore methods and tests
- saving/deleting/updating of encrypted DigiCert API tokens
- Integration test for DigiCert configs

This PR does not include the following:

- Making an HTTP call to DigiCert API for validation (in later PR)
- Changes file (in later PR)

# Checklist for submitter

- [x] If database migrations are included, checked table schema to
confirm autoupdate
- For 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`).
- [x] Added/updated automated tests
- [x] Manual QA for all new/changed functionality
2025-03-06 12:47:57 -06:00
Ian Littman
e7d04f2ff0
Clean up Python 3.12 vulns test expectations, fix continue-on-error behavior for integration and vulns suites (#26903)
From what I can tell, continue-on-error has been false for the
integration suites since the suites were renamed to `integration-*`, so
this fixes that issue in addition to continuing to run test suites when
the vulns suite fails (which may be due to vulns feed updates).

This also makes the vulns test more resilient to new CVEs being reported
on Python 3.12.0, which is rather likely to collect new CVEs.

# Checklist for submitter

- [x] Added/updated automated tests
2025-03-06 08:46:07 -06:00
Ian Littman
064700880c
Add caching of parsed CVE feeds during vulncheck hydration, don't save revised feeds until hydration is complete (#26801)
For #26870.

On my local, this gets us a differential vulns feed update (for this
part of it) in under 90 seconds, vs. taking on the order of...40
minutes, I think? RAM usage is a few GB, but we have headroom on GitHub
Actions and the performance increase is worth it.

# Checklist for submitter

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

<!-- Note that API documentation changes are now addressed by the
product design team. -->

- [ ] 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/Committing-Changes.md#changes-files)
for more information.
- [ ] Added/updated automated tests
- [ ] A detailed QA plan exists on the associated ticket (if it isn't
there, work with the product group's QA engineer to add it)
- [ ] Manual QA for all new/changed functionality
2025-03-05 18:06:37 -06:00
RachelElysia
88d4f8b4c6
Fleet UI: Surface policy automation scripts error messages (#26764) 2025-03-05 16:11:04 -05:00
Victor Lyuboslavsky
b976956b24
Add DigiCert configs. (#26780)
For #26603

This PR includes:
- DigiCert configs
- Some config code for custom SCEP, but not fully functional
- Validation tests for DigiCert Configs
- DigiCert activities (manually tested)

This PR does not include the following:
- Encryption of DigiCert API tokens -- this requires DB migration (in
next PR)
- Making an HTTP call to DigiCert API for validation (in later PR)
- Integration tests (in later PR)
- Changes file (in later PR)

# Checklist for submitter

- [x] Added/updated automated tests
- [x] Manual QA for all new/changed functionality
2025-03-05 15:02:26 -06:00
Martin Angers
a4f104fcce
Android: compute MDM enrollment stats (#26854) 2025-03-05 15:47:06 -05:00
Martin Angers
662bb2919c
Bugfix: Clear the unified queue when turning off and re-enrolling in MDM (#26816) 2025-03-05 08:59:07 -05:00
Lucas Manuel Rodriguez
fc96cc4e91
Merge commit from fork 2025-03-05 07:31:17 -06:00
Jahziel Villasana-Espinoza
4834a70e47
fix: move logic for mutating software versions so that Fleet shows the expected versions (#26789)
> For #24784

# Checklist for submitter

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

<!-- Note that API documentation changes are now addressed by the
product design team. -->

- [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/Committing-Changes.md#changes-files)
for more information.
- [x] Added/updated automated tests
- [x] A detailed QA plan exists on the associated ticket (if it isn't
there, work with the product group's QA engineer to add it)
- [x] Manual QA for all new/changed functionality
2025-03-04 16:22:03 -05:00
Victor Lyuboslavsky
faeb43f832
Scaffold for new integration tests. (#26747)
For #26219

Created a scaffold for server/service integration tests going forward.
- separate package
- no dependency on testify Suite
2025-03-04 12:04:25 -06:00
Victor Lyuboslavsky
488efd144e
Added DigiCert/SCEP activity structs. (#26786)
For #26603

Splitting this change from the rest of the DigiCert/SCEP config work
since it requires documentation signoff.
2025-03-04 11:02:44 -06:00
Gabriel Hernandez
c5f0f60723
add self closing successful Android enterprise connection page (#26767)
For #26736

adds a self closing page that is the final part of connecting with
Android Enterprise. This allows the user to see the fleet page
notification that android mdm is now enabled.
2025-03-04 16:32:44 +00:00
Scott Gress
1a1d7bae78
Clear cron schedule errors before each run (#26775)
For #26657

This PR fixes an issue that causes cron monitoring alerts to be sent
repeatedly after the first instance; that is, if a cron job fails once
then the monitor reports the failure every time it runs until the server
is restarted. This was due to the errors being held in the Schedule
object which persists for the lifetime of the process, rather than being
recreated for each run. The solution is to clear the errors from the
Schedule object before each run.

Added a test that fails on main and passes on this branch.
2025-03-03 16:41:48 -06:00
Jahziel Villasana-Espinoza
e552cd3c8e
added new vulns and continuesToUpdate to python alpha version cve tests (#26785)
> For #26748

# Checklist for submitter

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

<!-- Note that API documentation changes are now addressed by the
product design team. -->

- [x] Added/updated automated tests
- [x] Manual QA for all new/changed functionality
2025-03-03 16:50:25 -05:00
Martin Angers
5bcd98b317
Fix activity disappearing when software installer fails to download on host (#26758) 2025-03-03 12:44:09 -05:00
Ian Littman
5cfb723b6c
Add newly reported CVE-2025-1795 to test for Python 3.12.0 expected vulns (#26751)
For #26748. No changes file etc. as this is just a vulns feed
conformance test. This vuln came in from Vulncheck.

- [x] Added/updated automated tests
2025-03-03 09:05:13 -06:00
Martin Angers
949dbbd8c3
Android: Add android platform to the "generate MDM stats" cron job (#26621) 2025-03-03 08:55:12 -05:00