Commit graph

3396 commits

Author SHA1 Message Date
Scott Gress
fca1e1ab42
Add GitOps for policy labels (#27781)
For #27301 

# Checklist for submitter

<!-- 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

# Details

This PR adds the ability to set/unset labels on policies via GitOps. It
builds on https://github.com/fleetdm/fleet/pull/27575 (back end for
policy labels) and updates the `PolicySpec` type and `ApplyPolicySpecs`
methods to update the `policy_labels` table where needed.

## Testing

1. Create a few labels in the UI
1. Create a global policy "foo" in the UI without labels
2. Create a global policy "bar" in the UI with labels
2. Create a global policy "baz" in the UI with labels
4. Use `fleetctl gitops` with a global .yml file, and under `policies:`
add "foo", "bar", "baz" and "boop".
  * Add labels to "foo" with `labels_include_any:`
  * Don't add `labels_include_any:` to "bar"
* Add labels to "baz" with `labels_include_any:`, but different labels
than what you added in the UI
  * Add labels to "boop" with `labels_include_any:`

The expected outcome when viewing the queries in the UI (on the "edit
query" screen)
* Foo, Baz and Boop should have the labels specified in gitops
* Bar should have no labels

Repeat testing with _excluded_ labels.

---------

Co-authored-by: dantecatalfamo <dante.catalfamo@gmail.com>
Co-authored-by: Dante Catalfamo <43040593+dantecatalfamo@users.noreply.github.com>
2025-04-04 09:46:51 -05:00
Konstantin Sykulev
1e33641dd8
Filter out pending software on VulnerableOnly (#27859)
https://github.com/fleetdm/fleet/issues/27745
Related to https://github.com/fleetdm/fleet/pull/27752

When software is in a pending state, filter it out completely when
`VulnerableOnly` is true.
2025-04-03 15:52:45 -05:00
Ian Littman
0f2f085812
Add more test coverage for Fleet-maintained apps (#27722)
For #27377.

# 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
2025-04-03 09:18:27 -05:00
Victor Lyuboslavsky
8658608c37
Add SCIM Groups (#27702)
For #27287

This PR adds SCIM Groups to Fleet's SCIM endpoint as a follow on to SCIM
Users. The logic has been manually tested with Okta, and integration
tests will be in the next PR.

# Checklist for submitter
- [x] Added/updated automated tests
- [x] Manual QA for all new/changed functionality
2025-04-02 17:10:40 -05:00
Konstantin Sykulev
28c964b687
Filter pending installs/uninstalls for vulnerabilities (#27752)
If there is a pending install or uninstall for a software_title that has
a cooresponding software record (perhaps installed by another host),
then we need to apply the vulnerability joins to properly filter them.

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

# 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] 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-04-02 17:04:52 -05:00
Jahziel Villasana-Espinoza
779da3502b
remove assertions that are not super important and can fail when FMA list changes (#27813)
Updates a test that can fail whenever the FMA list changes; the
assertions are from back when FMA was macOS only, so they're OK to
remove (the important stuff is still being tested)

# 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
2025-04-02 17:17:15 -04:00
Dante Catalfamo
37932e0f97
Custom targets for policies - backend (#27575)
#27277
2025-04-02 12:36:03 -04:00
Martin Angers
69fcda9686
Cancel upcoming activities: DB schema and backend (#27710) 2025-04-01 14:08:56 -04:00
Victor Lyuboslavsky
2198fd8d65
Add SCIM Users (#27551)
For #27287

Video explaining the PR: https://www.youtube.com/watch?v=ZHgFUAvrPEI

This PR adds SCIM Users support for Okta. The goal is to first add
Users/Groups support so that the remaining backend SCIM work can be done
in parallel.

This PR does not include the following, which will be added in later PRs
- Changes file
- Groups support for Okta
- Full support for Entra ID
- Integration tests

# 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] 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-04-01 11:02:24 -05:00
Jahziel Villasana-Espinoza
25f81d3882
Drop descoped-from-4.66 Windows FMAs (#27714)
> No ticket, decided in a call with Noah, Tim, and the rest of
g-software

# 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] Manual QA for all new/changed functionality
2025-03-31 22:16:06 -04:00
Dan Tsekhanskiy
521ecfffa7
fix: Detect file starting with comment in mdm.go as well (#27673)
Addresses
https://github.com/fleetdm/fleet/issues/26443#issuecomment-2749360869
after https://github.com/fleetdm/fleet/pull/27176 was merged. Reading
XML as a string in this way feels wrong, but I don't want to avoid a
refactor, so I'm checking for a "comment" string in this PR.

I tested by building fleetctl locally and running:

```sh
$ make fleetctl; ./build/fleetctl gitops -f it-and-security/teams/test.yml --dry-run
...
Client Version:   tf-mod-addon-monitoring-v1.5.1-1091-g8eb9111c6-dirty
Server Version:  0.0.0-SNAPSHOT-85f4f65
[+] applying MDM profiles for team TEST
Error: applying custom settings for team "TEST": POST /api/latest/fleet/mdm/profiles/batch received status 422 Validation Failed: disable-onedrive is not a valid macOS or Windows configuration profile. macOS profiles must be valid .mobileconfig or .json files. Windows configuration profiles can only have <Replace> or <Add> top level elements.
```

I'm not sure if the error above
([code](8eb9111c67/server/service/mdm.go (L2160)))
is caused by my test environment not yet having the updated server code.
The `--dry-run` passed in my test, as seen by the `[+] applying MDM
profiles for team TEST` line. I can't get any test code to be reflected
in the server response, so my hunch is that the issue should be fixed
after this PR.

# 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.
- I did this in https://github.com/fleetdm/fleet/pull/27176, same change
message.
- [x] Added/updated automated tests
- [x] Manual QA for all new/changed functionality
2025-03-31 19:16:13 -05:00
Ian Littman
5ee8af62e0
Add Secureframe partnership override env var for transparency URL (#27388)
For #27309.

- [x] Manual QA for all new/changed functionality
- [x] Added automated tests
2025-03-31 14:43:17 -05:00
Ian Littman
0293d99800
Remove default EXE install/uninstall scripts, require entering install/uninstall scripts on EXE upload (#27268)
For #27267.

Below is what's shown immediately after selecting an EXE:

<img width="1254" alt="image"
src="https://github.com/user-attachments/assets/a28d8565-de88-448a-bdbc-92aefc34ad55"
/>


TODO:

* Tests
* GitOps requirements changes
* Disabling add button/adding errors when required scripts aren't
specified

# 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)
- [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: Luke Heath <luke@fleetdm.com>
Co-authored-by: Noah Talerman <47070608+noahtalerman@users.noreply.github.com>
Co-authored-by: RachelElysia <rachel@fleetdm.com>
2025-03-31 13:52:06 -05:00
Scott Gress
59f96651b6
Update to Go 1.24.1 (#27506)
For #26713 

# Details

This PR updates Fleet and its related tools and binaries to use Go
version 1.24.1.

Scanning through the changelog, I didn't see anything relevant to Fleet
that requires action. The only possible breaking change I spotted was:

> As [announced](https://tip.golang.org/doc/go1.23#linux) in the Go 1.23
release notes, Go 1.24 requires Linux kernel version 3.2 or later.

Linux kernel 3.2 was released in January of 2012, so I think we can
commit to dropping support for earlier kernel versions.

The new [tools directive](https://tip.golang.org/doc/go1.24#tools) is
interesting as it means we can move away from using `tools.go` files,
but it's not a required update.

# 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`.
- [x] Manual QA for all new/changed functionality
- For Orbit and Fleet Desktop changes:
- [X] Make sure fleetd is compatible with the latest released version of
Fleet
   - [x] Orbit runs on macOS  , Linux   and Windows. 
- [x] Manual QA must be performed in the three main OSs, macOS ,
Windows and Linux .
2025-03-31 11:14:09 -05:00
Martin Angers
f3d7ed86a8
Bugfix: support removing labels associated with profiles (custom settings) in gitops (#27546) 2025-03-31 11:42:43 -04:00
Martin Angers
888e4a6a7f
Fix data race with push notification in test (#27682)
Fix for
https://github.com/fleetdm/fleet/actions/runs/14098566529/job/39490440108
2025-03-31 10:21:25 -04:00
Sarah Gillespie
8d17956f7b
Skip bootstrap package and other setup items when renewing Apple MDM enrollment profiles (#27560) 2025-03-28 16:33:22 -05:00
Victor Lyuboslavsky
c904498297
DigiCert/SCEP: More tweaks to error messages (#27650)
For #27637 

# Checklist for submitter

- [x] Added/updated automated tests
- [x] For unreleased bug fixes in a release candidate, confirmed that
the fix is not expected to adversely impact load test results or alerted
the release DRI if additional load testing is needed.
2025-03-28 15:30:11 -05:00
Victor Lyuboslavsky
cd996c5138
Improved DigiCert/SCEP errors (#27640)
For #27637 

# Checklist for submitter

- [x] Added/updated automated tests
- [x] Manual QA for all new/changed functionality
- [x] For unreleased bug fixes in a release candidate, confirmed that
the fix is not expected to adversely impact load test results or alerted
the release DRI if additional load testing is needed.
2025-03-28 14:27:50 -05:00
Jahziel Villasana-Espinoza
edb0587061
add adobe acrobat reader for windows (#27642)
> for https://github.com/fleetdm/fleet/issues/26658

# 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] 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-28 15:17:07 -04:00
Jahziel Villasana-Espinoza
2802cf57d5
Update FMA refreshing logic to remove apps that were removed upstream (#27594)
> No issue, we noticed this while testing FMA for Windows

# 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-28 14:04:08 -04:00
Dante Catalfamo
97e3943dfa
A third and mysterious attempt at gitops ui mode (#27585)
#27294
2025-03-28 11:18:22 -04:00
Victor Lyuboslavsky
54e18d87bd
Fixing Fleet variable validation in <data> (#27604)
For #27603

Only fixing the UI issue. GitOps also has this issue, but GitOps does
not validate Fleet variables locally, so not an easy fix.

# Checklist for submitter
- [x] Manual QA for all new/changed functionality
- [x] For unreleased bug fixes in a release candidate, confirmed that
the fix is not expected to adversely impact load test results or alerted
the release DRI if additional load testing is needed.
2025-03-27 17:27:58 -05:00
Jahziel Villasana-Espinoza
658a298d5a
more fixes for FMA windows ingestion (#27487)
> For #26662

# 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] 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-27 17:43:40 -04:00
Ian Littman
b1fd576731
Ensure maintained apps are pulled immediately on next server start after FMAv2/WinFMA upgrade (#27589)
For #27582.

# 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] 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
- [x] For unreleased bug fixes in a release candidate, confirmed that
the fix is not expected to adversely impact load test results or alerted
the release DRI if additional load testing is needed.
2025-03-27 16:06:34 -05:00
jacobshandling
748b5bcd51
Full-stack: Make "Server url" validation conditions consistent across Fleet, update Web Address form validation and submission logic per Fleet best practices (frontend/docs/patterns.md) (#27455)
## For #27454 

Consider Fleet web URL to be valid if it:

- (Front end and back end): uses “https://” or “http://” scheme
 and
- (Front end) accepts only valid or "localhost" hosts (e.g., "a.b.cc" or
"localhost", but not "a.b")
- (Back end) accepts any host (e.g., "localhost", "a.b.cc", or even
"a.b")


### Setup flow UI URL validation:

![setup](https://github.com/user-attachments/assets/34a428d2-5731-46f2-b708-c88b790e3667)

### Org settings UI URL validation:

![org-settings](https://github.com/user-attachments/assets/147916c8-9c5b-4ae7-9e14-625c65b42d0a)

### Server URL validation:
<img width="1464" alt="invalid-url-server"
src="https://github.com/user-attachments/assets/83a112e1-6318-4b09-864d-fe66a223835d"
/>

### Invalid Fleet server URL in DB error:

![invalid-url-in-db](https://github.com/user-attachments/assets/aae591fb-6cc3-49bd-8556-22129be4c2c4)


- [x] Changes file added for user-visible changes in `changes/`,
- [x] 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)
- [x] Manual QA for all new/changed functionality

---------

Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
2025-03-27 13:56:38 -07:00
Jahziel Villasana-Espinoza
4290dbbd43
Fix issue with the list FMA query (#27576)
> For #27553

# 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-27 14:41:31 -04:00
Victor Lyuboslavsky
c3c99e4aa0
Fixed data replacement issue and empty UPN issue in DigiCert integration (#27574)
For #27570 - unreleased bug

# Checklist for submitter

- [x] Added/updated automated tests
- [x] Manual QA for all new/changed functionality
- [x] For unreleased bug fixes in a release candidate, confirmed that
the fix is not expected to adversely impact load test results or alerted
the release DRI if additional load testing is needed.
2025-03-27 11:27:21 -05:00
Dante Catalfamo
36e6ba3569
Add vmodule flag to list of hidden osquery flags (#25789)
#25487
2025-03-27 11:05:00 -04:00
Dante Catalfamo
587b2fc7b7
Check for invalid default serial number when fetching host details (#27470)
For #25993
2025-03-26 16:23:50 -04:00
Martin Angers
78c0d67e78
Bugfix: re-create deleted iOS/iPadOS host entries in Fleet if it checks in again via MDM (#27231) 2025-03-26 09:33:38 -04:00
Victor Lyuboslavsky
075f5bf890
Add code comments and fix typo. No functional changes. (#27494)
For #27472
2025-03-25 09:08:47 -05:00
Victor Lyuboslavsky
4b5cb913b7
Added explicit validation of FDEFileVaultOptions properties. (#27473)
For unreleased bug #27472 

# Checklist for submitter

- [x] Added/updated automated tests
- [x] Manual QA for all new/changed functionality
2025-03-24 19:36:36 -05:00
Victor Lyuboslavsky
09c2e2ff72
Added Apple Root Cert for gdmf request. (#27483)
I manually verified this fix by running the new
`github.com/fleetdm/fleet/v4/server/mdm/apple/gdmf/integrationtest` test
with and without the fix on a cloud Ubuntu server.

Without fix:
```
=== RUN   TestGetAssetMetadata
    gdmf_test.go:14:
        	Error Trace:	/root/fleet/server/mdm/apple/gdmf/integrationtest/gdmf_test.go:14
        	Error:      	Received unexpected error:
        	            	retrieving asset metadata: Get "https://gdmf.apple.com/v2/pmv": tls: failed to verify certificate: x509: certificate signed by unknown authority
        	Test:       	TestGetAssetMetadata
--- FAIL: TestGetAssetMetadata (3.53s)
FAIL
FAIL	github.com/fleetdm/fleet/v4/server/mdm/apple/gdmf/integrationtest	3.542s
FAIL
```

With fix:
```
=== RUN   TestGetAssetMetadata
--- PASS: TestGetAssetMetadata (0.39s)
PASS
ok  	github.com/fleetdm/fleet/v4/server/mdm/apple/gdmf/integrationtest	0.397s
```

# Checklist for submitter

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
- [x] Added/updated automated tests
- [x] Manual QA for all new/changed functionality
2025-03-24 19:26:36 -05:00
Ian Littman
1f42204002
Fix typo in "clean up duplicate Zoom" migration query (#27420) 2025-03-21 15:59:32 -05:00
Ian Littman
0d7b8c206c
Fix migration function name (#27415) 2025-03-21 15:02:14 -05:00
Victor Lyuboslavsky
b9ae1205c2
Different errors for configuration_profiles and batch endpoints. (#27411)
For #24862 

Unreleased bug.
Made disk encryption errors different between `configuration_profiles`
and `batch` endpoints.

# Checklist for submitter
- [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
- [x] For unreleased bug fixes in a release candidate, confirmed that
the fix is not expected to adversely impact load test results or alerted
the release DRI if additional load testing is needed.
2025-03-21 14:24:52 -05:00
Dante Catalfamo
593df5d2d9
Fix deadlock: reduce number rows deleted at per iter, add retry (#27027)
#27002
2025-03-21 13:48:39 -04:00
Konstantin Sykulev
beb7dfee99
Updated ListHostSoftware vulnerability filtering (#27020)
Include vulnerability filtering conditions on vpp apps and latest host
software installs/uninstalls

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

- [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: RachelElysia <rachel@fleetdm.com>
Co-authored-by: Jahziel Villasana-Espinoza <jahzielv@gmail.com>
2025-03-21 11:02:55 -05:00
Victor Lyuboslavsky
e7e9f54071
Updated FileVault and BitLocker error messages (#27365)
For #24862

# 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`.
- [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-21 09:56:50 -05:00
Victor Lyuboslavsky
92dd9a7deb
Another error message fix. (#27385)
Changed FLEET_VARS_ to FLEET_VAR_ in error message
2025-03-21 09:23:10 -05:00
Benjamin Edwards
c6178c64cd
add configuration setting for forcing h2c (#26799) 2025-03-21 09:38:21 -04:00
Dan Tsekhanskiy
e187b02c62
fix: Also set inValidNode when CSP starts with comment (#27376)
Addresses
https://github.com/fleetdm/fleet/issues/26443#issuecomment-2737439271
after https://github.com/fleetdm/fleet/pull/27176 was merged.

# 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.
- I did this in https://github.com/fleetdm/fleet/pull/27176, same change
message.
- [x] Added/updated automated tests
- [x] Manual QA for all new/changed functionality
2025-03-21 07:34:12 -05:00
Ian Littman
4a1e5340f0
Switch Fleet-maintained apps to use manifest-based structure (#27201)
For #26082.

# 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] 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-20 21:21:56 -05:00
Konstantin Sykulev
aad329b0da
Batched selectSoftwareVersionsSQL (#27361)
https://github.com/fleetdm/fleet/issues/26753

Missed a spot in https://github.com/fleetdm/fleet/pull/27062. The next
place in line that causes the placeholder overflow is
`selectSoftwareVersionsSQL`

- [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.
      ^ changes are in the previous PR 
- [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-20 16:47:24 -05:00
Scott Gress
7eebc22693
Add author ID to labels (#27055)
For #27035 

# 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] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)
- [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`).
- [ ] 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

## Details

This PR adds an `author_id` column to the `labels` table, and adds the
associated properties to the `Label` and `LabelSpec` types. When a new
label is created via the UI or API, an author ID is set on the label if
one can be inferred from the context. Otherwise, the author ID is set to
`null`.

## Authz and Automated testing

Additional backend authorization logic is introduced in a follow-on PR,
https://github.com/fleetdm/fleet/pull/27089, because rconciling all of
the test updates between this PR and
https://github.com/fleetdm/fleet/pull/27038 was getting complicated.

## Manual Testing

* Tested in the UI by creating a new label on the Hosts page
* Tested via Gitops by merging this branch with
https://github.com/fleetdm/fleet/pull/27038 and doing `fleetctl gitops`
with a global config with `labels:` in it.
2025-03-20 16:05:16 -05:00
Rachael Shaw
11e8ed27da
#24586 Use consistent language in error messages ("upload" -> "add") (#27316)
See #24586
2025-03-20 15:44:09 -05:00
Scott Gress
7b4d9aa487
Add labels to queries using gitops (#27259)
For #24473 

This PR allows users to add / update / remove labels from queries via
Gitops.

## Testing

1. Create a few labels in the UI
1. Create a global query "foo" in the UI without labels
2. Create a global query "bar" in the UI with labels
2. Create a global query "baz" in the UI with labels
4. Use `fleetctl gitops` with a global .yml file, and under `queries:`
and "foo", "bar", "baz" and "boop".
  * Add labels to "foo" with `labels_include_any:`
  * Don't add `labels_include_any:` to "bar"
* Add labels to "baz" with `labels_include_any:`, but different labels
than what you added in the UI
  * Add labels to "boop" with `labels_include_any:`

The expected outcome when viewing the queries in the UI (on the "edit
query" screen)
* Foo, Baz and Boop should have the labels specified in gitops
* Bar should have no labels
2025-03-20 15:32:52 -05:00
Victor Lyuboslavsky
0397126d7f
DigiCert error message updates. (#27360)
For #25822 

Additional DigiCert error message updates after doing backend QA.

The CI error is not related -- issue with Brew ingestion.
2025-03-20 15:13:55 -05:00
Victor Lyuboslavsky
93bdb437ac
Resend Windows profiles on change (#27308)
For #25030 

This PR includes the bug fix and tests.

It also includes the `secrets_updated_at` columns needed for story
#27351. These columns are currently unused and always NULL.

# 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] 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-20 14:43:04 -05:00