Commit graph

2997 commits

Author SHA1 Message Date
Lucas Manuel Rodriguez
4b4fc976a2
Add team_identifier to macOS software (#23766)
Changes to add `team_identifier` signing information to macOS
applications on the `/api/latest/fleet/hosts/:id/software` API endpoint.

Docs: https://github.com/fleetdm/fleet/pull/23743

- [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 tests
- [X] If paths of existing endpoints are modified without backwards
compatibility, checked the frontend/CLI for any necessary 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] Manual QA for all new/changed functionality
- For Orbit and Fleet Desktop changes:
- [X] Orbit runs on macOS, Linux and Windows. Check if the orbit
feature/bugfix should only apply to one platform (`runtime.GOOS`).
- [X] Manual QA must be performed in the three main OSs, macOS, Windows
and Linux.
- [X] Auto-update manual QA, from released version of component to new
version (see [tools/tuf/test](../tools/tuf/test/README.md)).

---------

Co-authored-by: Tim Lee <timlee@fleetdm.com>
Co-authored-by: Ian Littman <iansltx@gmail.com>
2024-11-15 14:17:04 -03:00
Dante Catalfamo
167e2e3e28
Scope pending host profile rebuilds (#23772)
#21338
2024-11-15 11:55:30 -05:00
Jahziel Villasana-Espinoza
e27e916f74
fix: re-enroll devices that are removed from ABM and then added back (#23757)
> Related issue: #23200

# 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 tests
- [x] Manual QA for all new/changed functionality
2024-11-14 18:31:12 -05:00
Sarah Gillespie
b8c9816e53
Custom OS settings: "include any label" option for custom target (#23802) 2024-11-14 11:10:49 -06:00
Ian Littman
4f726a724c
Allow Fleet Premium users to opt out of populating vulnerability details when populating software in the hosts list endpoint (#23710)
#23078

This endpoint is drastically more efficient, and returns a much smaller
response payload, when vulnerability details aren't returned, and
vulnerability details can be looked up more efficiently in the
/vulnerabilities/CVE-XXXX-YYYY endpoint as that endpoint returns the
description once overall rather than once per host.

# 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 tests
- [x] Manual QA for all new/changed functionality
2024-11-14 11:09:51 -06:00
gillespi314
de2dd61c1f Update schema 2024-11-14 08:35:00 -06:00
gillespi314
28e4cf6cf7 Merge branch 'main' into feat-include-any-label 2024-11-14 08:33:03 -06:00
Sarah Gillespie
16d0d8d58f
Fix unreleased bugs with labels_include_any feature (#23734) 2024-11-14 08:30:32 -06:00
Konstantin Sykulev
48b992e268
Modify status code for software batch endpoint (#23711)
When using the `fleet/software/batch` endpoint, due to its async nature,
it should return a 202 (Accepted) rather than a 200 (Ok).

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

# 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 tests
- [x] Manual QA for all new/changed functionality
2024-11-13 17:22:51 -06:00
Jahziel Villasana-Espinoza
6a26b894b3
fix: update test with new vulns (#23775)
> No ticket, just fixing a broken test

# 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 tests
2024-11-13 14:15:31 -05:00
Jahziel Villasana-Espinoza
e3618e8335
fix: return error in gitops if using deprecated field and there are more than 1 abm tokens (#23768)
> Related issue: #22359

# 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 tests
- [x] Manual QA for all new/changed functionality
2024-11-13 14:07:59 -05:00
Zach Wasserman
8c21dff636
Add capability to serve YARA rules via authenticated Fleet endpoints (#23343)
Implements the Fleet side of #14899

- Add new endpoints to update and retrieve yara rules
- Add support in fleetctl for applying the rules

# 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/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)
- [ ] Added support on fleet's osquery simulator `cmd/osquery-perf` for new osquery data ingestion features.
- [x] Added/updated tests
- [ ] If paths of existing endpoints are modified without backwards compatibility, checked the frontend/CLI for any necessary 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.
  - [ ] 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] Manual QA for all new/changed functionality
2024-11-13 09:01:08 -08:00
Victor Lyuboslavsky
7e7000a043
Added binary UUIDs to backend patterns (#23752)
As discussed in last Backend sync.
2024-11-13 09:27:18 -06:00
Martin Angers
e5febe960d
Bugfix: create/update manual label returns outdated info when configured with a mysql replica (#23725) 2024-11-13 08:57:22 -05:00
Martin Angers
c3ebce9293
Improve memory usage of software installers parsing (#23596) 2024-11-12 09:28:08 -05:00
Dante Catalfamo
17c3a1e552
Update golden scripts for warp and box fix (#23696)
#22773

Added/updated tests
2024-11-11 17:00:03 -05:00
Victor Lyuboslavsky
cab2426bf4
Added better handling of timeout and insufficient permissions errors in NDES SCEP proxy. (#23654)
#23525

# Demo
<div>
<a href="https://www.loom.com/share/e252ac2038b34941a9043867f79228f3">
<p>[Demo] Handling timeout and insufficient permission errors in NDES
#23525 - Watch Video</p>
    </a>
<a href="https://www.loom.com/share/e252ac2038b34941a9043867f79228f3">
<img style="max-width:300px;"
src="https://cdn.loom.com/sessions/thumbnails/e252ac2038b34941a9043867f79228f3-2ff60eb9e0f54dd5-full-play.gif">
    </a>
  </div>

# 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 tests
- [x] Manual QA for all new/changed functionality
2024-11-11 14:57:28 -06:00
Jahziel Villasana-Espinoza
59abd8b1d0
fix: update logic for filtering VPP apps based on host MDM status (#23656)
> Related issue: #23247 

# 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 tests
- [x] Manual QA for all new/changed functionality
2024-11-11 14:35:05 -05:00
Victor Lyuboslavsky
90915b9e1d
Allow to disable Apple MDM SCEP renewal/verification (#23660)
https://github.com/fleetdm/confidential/issues/8528

Manual merge from special branch
https://github.com/fleetdm/fleet/compare/rc-patch-fleet-v4.57.3...rh-patch-4.57.3,
gated by env vars.

No changes entry since this is a temporary feature for a customer, which
we may not want to maintain.
2024-11-11 13:25:21 -06:00
Dante Catalfamo
915213a0a3
Fix uninstall for Warp and Box (#23652)
#22773
2024-11-11 14:20:31 -05:00
Ian Littman
d746b9179a
Record activity when activity automations are enabled/edited/disabled (#23477)
#21709, re-roll/expansion of work done by @ilpianista in #21368

# 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 tests
- [x] Manual QA for all new/changed functionality

---------

Co-authored-by: Andrea Scarpino <andrea@scarpino.dev>
2024-11-08 09:07:56 -06:00
Ian Littman
cfead6a35f
Fix path resolution for installer queries and scripts to always be relative to where the query file or script is referenced (#23502)
#22187

Similar fix to #22555: resolve paths at spec parsing time rather than
when trying to grab files

# 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 tests
- [x] Manual QA for all new/changed functionality
2024-11-07 11:22:08 -06:00
Ian Littman
c797fb73c2
Delete pending script executions when the underlying script is edited or deleted (#23520)
#21888 

# 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 tests
- [x] Manual QA for all new/changed functionality
2024-11-06 18:15:52 -06:00
Rachael Shaw
1e0c482290
#23314: Rename "Transparency" menu item in Fleet Desktop (#23392)
Took a stab at implementing #23314 since it is a text change only.

Documentation changes are
[here](https://github.com/fleetdm/fleet/pull/23375); if this gets merged
I'll make a new PR to the v4.60.0 docs.

---------

Co-authored-by: Ian Littman <iansltx@gmail.com>
2024-11-06 17:00:37 -06:00
Jahziel Villasana-Espinoza
aed3c3f775 chore: merge in main 2024-11-06 10:13:47 -05:00
Jahziel Villasana-Espinoza
a23980347b
feat: initial readme for cron jobs (#23563)
We discussed at backend sync today (2024-11-05) that we'd like to start
adding READMEs in the codebase for very tactical documentation.

This is an inital README for the cron/scheduling machinery.
2024-11-06 09:13:45 -05:00
Jahziel Villasana-Espinoza
0095b3be89
feat: update profile reconciliation logic to handle include-any label relationships (#23535)
> Related issue: #22581

# 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 tests
- [x] Manual QA for all new/changed functionality

---------

Co-authored-by: gillespi314 <73313222+gillespi314@users.noreply.github.com>
2024-11-06 09:13:37 -05:00
Dante Catalfamo
aa3fd29c13
Profile Labels Include Any CLI (#23434)
#22576


Co-authored-by: Sarah Gillespie <73313222+gillespi314@users.noreply.github.com>
2024-11-05 15:13:44 -05:00
Sarah Gillespie
d050ddbeb1
Update API for MDM profiles with "include any" labels option (#23456) 2024-11-05 12:12:22 -06:00
Victor Lyuboslavsky
5eb88d13ce
Fix flaky TestLifecycleSCEPExpiration test. (#23534)
#20936

# Checklist for submitter
- [x] Added/updated tests
2024-11-05 12:06:21 -06:00
Victor Lyuboslavsky
3cf99f8039
Enable staticcheck Go linter. (#23487)
#23486 

Linter: https://staticcheck.dev/
2024-11-05 11:16:24 -06:00
Martin Angers
2f54879f2a
Bugfix: config profile deployment based on label exclusion (#23533) 2024-11-05 11:58:31 -05:00
Ian Littman
257fc8590d
Expose counts_updated_at on software title by-ID endpoint, show in UI (#23478)
#22269

# 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 tests
- [x] Manual QA for all new/changed functionality
2024-11-05 09:54:02 -06:00
Victor Lyuboslavsky
9e1c451e2b
Fully deleting pending host. (#23503)
#23204 

When deleting Pending hosts, using the standard `ds.DeleteHosts` method.
This seems cleaner and more scalable than trying to handle every host
table in cleanups cron.

# Checklist for submitter

- [x] Added/updated tests
- [x] Manual QA for all new/changed functionality
2024-11-05 09:47:28 -06:00
Victor Lyuboslavsky
1d972b2853
Fix overwritten NDES errors. (#23506)
#23505 
Unreleased NDES bug

Profile error was being overwritten by a subsequent DB update.

# Checklist for submitter
- [x] Added/updated tests
- [x] Manual QA for all new/changed functionality
2024-11-04 15:44:52 -06:00
Ian Littman
8258d481a1
Clear pending (un)installs when installers are deleted (#23427)
For unreleased bug #23350, introduced because we're no longer
cascade-deleting _all_ related installs (related to #22996, #21654,
#22087)

# Checklist for submitter

- [x] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)
- [x] Added/updated tests
- [x] Manual QA for all new/changed functionality
2024-10-31 18:04:06 -05:00
Victor Lyuboslavsky
bab0e159a9
Adding telemetry for specific Fleet Desktop errors (#23349)
Adding telemetry for catching issue #19172

# Docs changes

In another PR: https://github.com/fleetdm/fleet/pull/23423/files

# Demo
<div>
<a href="https://www.loom.com/share/233625875eec46508c26ae315cd52d19">
<p>[Demo] Add telemetry for vital fleetd errors - Issue #23413 - Watch
Video</p>
    </a>
<a href="https://www.loom.com/share/233625875eec46508c26ae315cd52d19">
<img style="max-width:300px;"
src="https://cdn.loom.com/sessions/thumbnails/233625875eec46508c26ae315cd52d19-45ca0ec1b7b5e9e7-full-play.gif">
    </a>
  </div>

# 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 tests
- [x] Manual QA for all new/changed functionality
- For Orbit and Fleet Desktop changes:
- [x] Orbit runs on macOS, Linux and Windows. Check if the orbit
feature/bugfix should only apply to one platform (`runtime.GOOS`).
- [x] Manual QA must be performed in the three main OSs, macOS, Windows
and Linux.
- [x] Auto-update manual QA, from released version of component to new
version (see [tools/tuf/test](../tools/tuf/test/README.md)).
2024-10-31 14:24:42 -05:00
Martin Angers
2d929115ad
Add automated test for the release device iPhone/iPad flow (#23416)
Follow-up to #23340 

# Checklist for submitter
- [x] Added/updated tests
2024-10-30 21:58:52 -04:00
Jahziel Villasana-Espinoza
5331019735
feat: migration for new col (#23391)
> Related issue: #22578

# 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 tests
- [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] Manual QA for all new/changed functionality
2024-10-30 21:58:34 -04:00
Martin Angers
4aa96a8c9b
Bugfix: unblock ADE enrollments for hosts on an old fleetd version (#23389) 2024-10-30 15:28:32 -04:00
Sarah Gillespie
f380492f60
Allow gitops users to run MDM commands (#23308) 2024-10-30 11:00:06 -05:00
Ian Littman
3d9134052f
Retime Nudge to 20:00 UTC (#23373)
- @noahtalerman: 12p (noon) PST for Nudge and 12p local time for DDM

See #23320 and #21998

# 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 tests
- [ ] Manual QA for all new/changed functionality

@xpkoala @PezHub Do y'all have a macOS 13 VM handy to test this? Test
plan would be:

1. Set OS update deadline for tomorrow
2. Enroll a macOS 13 host
3. Tonight at 9:15pm Pacific there shouldn't be a nudge (there would be
with the old behavior)
4. Tomorrow at 9:15am Pacific there shouldn't be a nudge (there would be
with the old behavior)
5. Tomorrow at 12:15pm Pacific there _should_ be a nudge (well, 15
minutes earlier-ish)

/cc @noahtalerman
2024-10-30 09:08:43 -05:00
Martin Angers
9e91549d05
Bugfix: fix automaticrelease of iOS/iPadOS device during ADE enrollment (#23360) 2024-10-29 17:05:26 -04:00
Victor Lyuboslavsky
e2d9a9016c
Add gosimple linter (#23250)
#23249

Add gosimple linter to golangci-lint CI job.
2024-10-29 14:17:51 -05:00
Ian Littman
12b29143c5
Merge duplicate package entries for deb-installed Python packages for Debian (#23325)
#22219

Note caveats in added tests; we may need to add more matching logic here
based on the Debian Bookworm repro I did.

# 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 tests
- [x] Manual QA for all new/changed functionality
2024-10-29 11:16:09 -05:00
Dante Catalfamo
6e9955d7c7
Add clause to exclude VPP apps from host software list (#23207) 2024-10-28 15:48:54 -04:00
Victor Lyuboslavsky
59a26db1f8
Limit OpenTelemetry span name length. (#23281)
Minor tweak to OpenTelemetry SQL config.

- [x] Manual testing
2024-10-28 10:50:35 -05:00
Martin Angers
d5c9a165e5
Bugfix and SE: support VPP apps and (install during setup of VPP apps) in gitops for no-team (#23160) 2024-10-28 10:35:57 -04:00
Jahziel Villasana-Espinoza
862585447d fix: migration order 2024-10-25 18:11:56 -04:00
Jahziel Villasana-Espinoza
3bc1d50456 fix: migration order 2024-10-25 18:05:48 -04:00