fleet/server/datastore/mysql
Ian Littman 89ca35c66b
Switch vulns cron false positive clear to clear vulns based on when the vulns run started, rather than based on periodicity (#31364)
Fixes #26404.

This means that for long vulns runs vulns will stick around longer, so
we don't wind up nuking vulns that were added earlier in the run, and in
cases where the vulns run takes less than 2h we'll see vulns clear
cleanly more quickly.

# 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

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

---------

Co-authored-by: Jahziel Villasana-Espinoza <jahziel@fleetdm.com>
2025-07-29 10:14:14 -05:00
..
common_mysql Add SCEP endpoint for host identity. (#30589) 2025-07-11 11:44:07 -03:00
migrations BMAA: Add personal enrollment type including aggregate counts (#31091) 2025-07-22 17:24:19 -04:00
testdata Removes duplicates when listing software titles on 'All teams' (#29459) 2025-06-07 10:47:53 -04:00
activities.go change previously installed apps to managed (#31061) 2025-07-18 16:49:12 -04:00
activities_test.go Add api_only key to activities API (#30353) 2025-06-30 16:49:04 -04:00
aggregated_stats.go Updating golangci-lint to 1.61.0 (#22973) 2024-10-18 12:38:26 -05:00
aggregated_stats_test.go Performance stats for live queries (#15440) 2023-12-13 14:46:59 -06:00
android.go Refactoring Android datastore interface (#26982) 2025-03-13 14:28:52 -05:00
android_test.go BMAA: Add personal enrollment type including aggregate counts (#31091) 2025-07-22 17:24:19 -04:00
app_configs.go Switch vulns cron false positive clear to clear vulns based on when the vulns run started, rather than based on periodicity (#31364) 2025-07-29 10:14:14 -05:00
app_configs_test.go Add config for requiring BitLocker PIN (#31109) 2025-07-23 14:38:49 -05:00
apple_mdm.go BMAA: Add personal enrollment type including aggregate counts (#31091) 2025-07-22 17:24:19 -04:00
apple_mdm_ddm_test.go Fixing issues with Apple DDM profile status (#29059) 2025-05-15 13:05:25 -05:00
apple_mdm_test.go BMAA: Add personal enrollment type including aggregate counts (#31091) 2025-07-22 17:24:19 -04:00
ca_config_assets.go Add custom SCEP configs (#27045) 2025-03-14 12:16:51 -05:00
ca_config_assets_test.go Add custom SCEP configs (#27045) 2025-03-14 12:16:51 -05:00
calendar_events.go Enable staticcheck Go linter. (#23487) 2024-11-05 11:16:24 -06:00
calendar_events_test.go Handle null HostID on calendar webhook endpoint (#30130) 2025-06-23 13:10:10 -04:00
campaigns.go Updating golangci-lint to 1.61.0 (#22973) 2024-10-18 12:38:26 -05:00
campaigns_test.go Updating golangci-lint to 1.61.0 (#22973) 2024-10-18 12:38:26 -05:00
carves.go Updating golangci-lint to 1.61.0 (#22973) 2024-10-18 12:38:26 -05:00
carves_test.go
challenges.go Update documentation for custom SCEP proxy (#29971) 2025-06-16 12:00:27 -05:00
conditional_access_microsoft.go Microsoft Compliance Partner backend changes (#29540) 2025-06-11 14:22:46 -03:00
conditional_access_microsoft_test.go Add app_sso_platform table to orbit and use table in Entra ID query ingestion (#30140) 2025-06-20 17:01:38 -03:00
config.go Refactoring common mysql (#26367) 2025-02-18 15:28:54 -06:00
cron_stats.go Monitor and alert on errors in cron jobs (#24347) 2024-12-19 15:55:29 -06:00
cron_stats_test.go Monitor and alert on errors in cron jobs (#24347) 2024-12-19 15:55:29 -06:00
delete.go Updating golangci-lint to 1.61.0 (#22973) 2024-10-18 12:38:26 -05:00
delete_test.go
disk_encryption.go Add encryption_key_archived to host details API response (#30850) 2025-07-15 13:21:39 -05:00
disk_encryption_test.go Re-verify Linux disk encryption #26693 (#29034) 2025-05-22 16:15:26 -04:00
email_changes.go
email_changes_test.go
errors.go Refactoring common mysql (#26367) 2025-02-18 15:28:54 -06:00
fulltext.go Update to Go 1.24.1 (#27506) 2025-03-31 11:14:09 -05:00
fulltext_test.go
host_certificates.go Properly filter host certificates by host on update when multiple hosts share the same certificate (#30578) 2025-07-05 19:44:31 -05:00
host_certificates_test.go Properly filter host certificates by host on update when multiple hosts share the same certificate (#30578) 2025-07-05 19:44:31 -05:00
host_identity_scep.go Host identity SCEP rate limit. (#31038) 2025-07-18 10:04:14 -03:00
host_identity_scep_test.go Fleet server verifies HTTP signature (#30825) 2025-07-16 20:08:27 +02:00
hosts.go BMAA: Add personal enrollment type including aggregate counts (#31091) 2025-07-22 17:24:19 -04:00
hosts_test.go BMAA: Add personal enrollment type including aggregate counts (#31091) 2025-07-22 17:24:19 -04:00
invites.go Allow opting in users to email verification on login (#24273) 2024-12-05 08:37:10 -06:00
invites_test.go Allow opting in users to email verification on login (#24273) 2024-12-05 08:37:10 -06:00
jobs.go Speedup worker-based device release on ADE enrollment setup (#29892) 2025-06-16 13:14:25 -04:00
jobs_test.go Speedup worker-based device release on ADE enrollment setup (#29892) 2025-06-16 13:14:25 -04:00
labels.go Managed Apple account user enrollment - integrate PoC changes (#30755) 2025-07-15 15:02:11 -04:00
labels_test.go BMAA: Add personal enrollment type including aggregate counts (#31091) 2025-07-22 17:24:19 -04:00
linux_mdm.go Linux OS settings + disk encryption host filter fixes (#24200) 2024-11-26 19:26:22 -06:00
linux_mdm_test.go 30311: Fix race condition in test (#30903) 2025-07-17 10:20:49 -04:00
locks.go Optimize software_titles query to use indexes (#25722) 2025-01-23 15:48:21 -03:00
locks_test.go Improvements for select next Apple MDM command query. (#24128) 2024-12-05 12:02:48 -06:00
maintained_apps.go Support for fleet maintained apps in gitops (#28751) 2025-05-07 18:16:08 -05:00
maintained_apps_test.go Persist download URL when adding FMAs via non-GitOps API, fix software versions on GitOps YAML generation (#30331) 2025-06-26 14:29:23 -05:00
mdm.go BMAA: SCEP Renewal (#31006) 2025-07-18 16:45:00 -04:00
mdm_test.go BMAA: Add personal enrollment type including aggregate counts (#31091) 2025-07-22 17:24:19 -04:00
microsoft_mdm.go Use dedicated, string-interpolated queries for single-host MDM status checks to reduce prepared statement usage (#30264) 2025-06-24 10:12:33 -05:00
microsoft_mdm_test.go BMAA: Add personal enrollment type including aggregate counts (#31091) 2025-07-22 17:24:19 -04:00
migrations_test.go Refactoring common mysql (#26367) 2025-02-18 15:28:54 -06:00
mysql.go Host identity SCEP rate limit. (#31038) 2025-07-18 10:04:14 -03:00
mysql_test.go Refactoring common mysql (#26367) 2025-02-18 15:28:54 -06:00
nanomdm_storage.go Bugfix: Clear the unified queue when turning off and re-enrolling in MDM (#26816) 2025-03-05 08:59:07 -05:00
nanomdm_storage_test.go 19016 ingest certs on start (#19360) 2024-05-30 18:18:42 -03:00
operating_system_vulnerabilities.go Switch vulns cron false positive clear to clear vulns based on when the vulns run started, rather than based on periodicity (#31364) 2025-07-29 10:14:14 -05:00
operating_system_vulnerabilities_test.go Switch vulns cron false positive clear to clear vulns based on when the vulns run started, rather than based on periodicity (#31364) 2025-07-29 10:14:14 -05:00
operating_systems.go Android scaffold (#26274) 2025-02-13 14:32:19 -06:00
operating_systems_test.go Updating golangci-lint to 1.61.0 (#22973) 2024-10-18 12:38:26 -05:00
packs.go Updating golangci-lint to 1.61.0 (#22973) 2024-10-18 12:38:26 -05:00
packs_test.go Enable staticcheck Go linter. (#23487) 2024-11-05 11:16:24 -06:00
password_reset.go Updating golangci-lint to 1.61.0 (#22973) 2024-10-18 12:38:26 -05:00
password_reset_test.go Updating golangci-lint to 1.61.0 (#22973) 2024-10-18 12:38:26 -05:00
policies.go Add retry mechanism to SavePolicy to reduce/eliminate deadlock errors… (#30550) 2025-07-03 14:29:16 -03:00
policies_test.go 30311: Fix race condition in test (#30903) 2025-07-17 10:20:49 -04:00
queries.go Add retry when applying queries (#28951) 2025-05-13 12:06:20 -05:00
queries_test.go Add labels to queries using gitops (#27259) 2025-03-20 15:32:52 -05:00
query_results.go Added server_settings.query_report_cap (#19692) 2024-06-14 12:24:01 -03:00
query_results_test.go 30311: Fix race condition in test (#30903) 2025-07-17 10:20:49 -04:00
scep.go Add SCEP endpoint for host identity. (#30589) 2025-07-11 11:44:07 -03:00
scep_test.go use Fleet instead of FleetDM in certificates (#19748) 2024-06-14 11:08:49 -03:00
scheduled_queries.go Update to Go 1.24.1 (#27506) 2025-03-31 11:14:09 -05:00
scheduled_queries_test.go Performance stats for live queries (#15440) 2023-12-13 14:46:59 -06:00
schema.sql Add config for requiring BitLocker PIN (#31109) 2025-07-23 14:38:49 -05:00
scim.go Update PATCH /fleet/scim/Groups/<group name> endpoint to handle duplicate entries (#30533) 2025-07-07 09:33:17 -05:00
scim_test.go 30311: Fix race condition in test (#30903) 2025-07-17 10:20:49 -04:00
scripts.go Add host uninstall results endpoint tests, don't filter out non-self-service uninstalls (#29838) 2025-06-09 15:15:27 -06:00
scripts_test.go Filter hosts by batch script execution status (#29547) 2025-06-05 18:53:14 -06:00
secret_variables.go Exclude certain sections from var interpolation when running gitops cmd (#28625) 2025-04-29 15:09:25 -04:00
secret_variables_test.go Update Apple config/DDM profiles if secret variables changed (#24995) 2024-12-30 17:58:39 -06:00
sessions.go Include expiration info, drop "personalized", in MFA email (#24630) 2024-12-10 18:58:40 -06:00
sessions_test.go Include expiration info, drop "personalized", in MFA email (#24630) 2024-12-10 18:58:40 -06:00
setup_experience.go stop erroring if a VPP app with darwin and ios versions is added to setup experience (#30187) 2025-06-20 13:17:25 -04:00
setup_experience_test.go stop erroring if a VPP app with darwin and ios versions is added to setup experience (#30187) 2025-06-20 13:17:25 -04:00
software.go Switch vulns cron false positive clear to clear vulns based on when the vulns run started, rather than based on periodicity (#31364) 2025-07-29 10:14:14 -05:00
software_installers.go Skip software installers for which we can't, or don't need to, parse package IDs/create uninstall scripts (#31347) 2025-07-28 13:58:19 -05:00
software_installers_test.go Extract UpgradeCode from MSI custom packages, use for better uninstall script generation (#30969) 2025-07-17 10:33:23 -05:00
software_test.go Switch vulns cron false positive clear to clear vulns based on when the vulns run started, rather than based on periodicity (#31364) 2025-07-29 10:14:14 -05:00
software_titles.go Removes duplicates when listing software titles on 'All teams' (#29459) 2025-06-07 10:47:53 -04:00
software_titles_test.go 30311: Fix race condition in test (#30903) 2025-07-17 10:20:49 -04:00
statistics.go Add statistic to measure ABM pending hosts (#28226) 2025-04-15 11:30:07 -04:00
statistics_test.go Add statistic to measure ABM pending hosts (#28226) 2025-04-15 11:30:07 -04:00
targets.go Updating golangci-lint to 1.61.0 (#22973) 2024-10-18 12:38:26 -05:00
targets_test.go Refactor EnrollOrbit/EnrollHost (#30872) 2025-07-15 17:22:02 -03:00
teams.go Avoid unnecessary prepared statements in "select config from team" uncached queries (#30206) 2025-06-23 21:09:55 -05:00
teams_test.go 30311: Fix race condition in test (#30903) 2025-07-17 10:20:49 -04:00
testing_utils.go Removes duplicates when listing software titles on 'All teams' (#29459) 2025-06-07 10:47:53 -04:00
unicode_test.go Bugfix: only count hosts that user has permission to see in count field of label endpoints (#18859) 2024-05-21 12:02:08 -04:00
users.go Prevent user invite race condition (#29559) 2025-05-29 15:26:02 -04:00
users_test.go Prevent user invite race condition (#29559) 2025-05-29 15:26:02 -04:00
vpp.go remove 'lock' on verification commands when MDM is turned off (#31023) 2025-07-17 21:50:18 -04:00
vpp_test.go 30311: Fix race condition in test (#30903) 2025-07-17 10:20:49 -04:00
vulnerabilities.go Fix insufficient deduplication on vulnerabilities count query (#31021) 2025-07-17 17:40:21 -05:00
vulnerabilities_test.go Fix insufficient deduplication on vulnerabilities count query (#31021) 2025-07-17 17:40:21 -05:00
windows_updates.go
windows_updates_test.go Updating golangci-lint to 1.61.0 (#22973) 2024-10-18 12:38:26 -05:00
wstep.go Add SCEP endpoint for host identity. (#30589) 2025-07-11 11:44:07 -03:00
wstep_test.go Move nanomdm dependency in monorepo (#16015) 2024-01-11 23:28:48 -03:00