fleet/server/fleet
Victor Lyuboslavsky a23d24bf96
Allow configuring webhook policy automations for "No team" (#32129)
Fixes #32060 

This PR adds:
- new default_team_config_json table
- caching of config from that table, including deep copy methods -- all
of this is not absolutely needed for this change since we are only using
`webhook_settings.failing_policies_webhook` here but added for
completeness/future
- teams/0 API updates
- GitOps updates
- generate gitops updates

Future PRs will add:
- ticket automation
- primo mode migration
- frontend changes
- documentation

# 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`.
- [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

## Database migrations

- [x] Checked table schema to confirm autoupdate

## New Fleet configuration settings

- [x] Verified that the setting is exported via `fleetctl
generate-gitops`
- [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)

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

## Summary by CodeRabbit

- New Features
- Configure failing-policy webhooks for “No team” via GitOps
(no-team.yml) and API, including enable/disable, destination URL, policy
IDs, and batch size; settings clear when omitted.
- GitOps and CLI now read/apply the real “No team” settings with dry-run
support.
- Policy automation evaluates hosts without a team and triggers “No
team” webhooks when applicable.
  - GET/PATCH team 0 returns/accepts a minimal, webhook-focused config.

- Chores
- Added persistence and caching for the default “No team” configuration.
  - Introduced a database table to store the default configuration.

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

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-08-28 16:38:27 -05:00
..
policytest Updating golangci-lint to 1.61.0 (#22973) 2024-10-18 12:38:26 -05:00
activities.go fix: standardize team_id handling in policy activities (#32151) 2025-08-27 08:43:36 -05:00
agent_options.go Generate new osquery 5.18.1 flags, catch up VEX report (#31648) 2025-08-08 10:49:23 -03:00
agent_options_generated.go Generate new osquery 5.18.1 flags, catch up VEX report (#31648) 2025-08-08 10:49:23 -03:00
agent_options_test.go Update to Go 1.24.1 (#27506) 2025-03-31 11:14:09 -05:00
aggregated_stats.go Performance stats for live queries (#15440) 2023-12-13 14:46:59 -06:00
app.go Add backend APIs for adding, deleting and listing secret variables (#31936) 2025-08-14 19:33:47 -03:00
app_test.go Bump github.com/go-git/go-git/v5 from 5.11.0 to 5.13.0 (#25280) 2025-01-09 12:09:49 -06:00
apple_mdm.go 31167: SUSP api (#32163) 2025-08-26 11:31:06 -04:00
apple_mdm_test.go Fix GitOps dry run issue with validating profiles with secrets (#32104) 2025-08-22 09:37:12 -05:00
authz.go Cancel upcoming activities: DB schema and backend (#27710) 2025-04-01 14:08:56 -04:00
calendar.go Update Google Calendar event bodies and relevant previews in the Fleet UI (#28715) 2025-05-01 13:12:53 -07:00
calendar_events.go Handle null HostID on calendar webhook endpoint (#30130) 2025-06-23 13:10:10 -04:00
calendar_events_test.go Fixed issue where callback was clearing event body tag. (#20997) 2024-08-05 13:44:30 -03:00
campaigns.go Added a new synchronous live query endpoint: POST /api/v1/fleet/queries/:id/run (#15860) 2024-01-03 09:39:16 -06:00
capabilities.go Add LUKS escrow trigger and orbit config endpoints, persist/retrieve LUKS passphrase (#23763) 2024-11-18 16:44:25 -06:00
capabilities_test.go fix panic if concurrent requests write capabilities (#13278) 2023-08-10 19:49:07 -03:00
carves.go report errors that can occur during file carving (#8972) 2022-12-09 13:21:30 -03:00
conditional_access_microsoft.go Microsoft Compliance Partner backend changes (#29540) 2025-06-11 14:22:46 -03:00
cron_schedules.go Batch script cron schedule (#31808) 2025-08-14 14:44:47 -04:00
datastore.go Allow configuring webhook policy automations for "No team" (#32129) 2025-08-28 16:38:27 -05:00
db.go Improvements for select next Apple MDM command query. (#24128) 2024-12-05 12:02:48 -06:00
device.go Hide "Self-service" in Fleet Desktop and My device page (#20047) 2024-07-02 11:32:49 -05:00
digicert.go Renewal of DigiCert certificates on macOS (#28449) 2025-04-24 08:35:15 -04:00
emails.go Migrate from aws-sdk-go v1 to v2 (#30308) 2025-06-30 17:45:39 -03:00
emails_test.go Custom email device-mapping: implement the CLI (fleetd + fleetctl) changes (#15763) 2023-12-21 11:22:59 -06:00
errors.go Validate Require BitLocker PIN (#32240) 2025-08-26 13:23:24 -04:00
errors_test.go Adding telemetry for specific Fleet Desktop errors (#23349) 2024-10-31 14:24:42 -05:00
fleet_vars.go Prevent IT admins from deleting a secret variable in use (#32161) 2025-08-22 11:22:37 -03:00
fleet_vars_test.go Prevent IT admins from deleting a secret variable in use (#32161) 2025-08-22 11:22:37 -03:00
fleetctl.go Remove kolide types and packages from backend (#974) 2021-06-06 15:07:29 -07:00
gen_activity_doc.go Update docs: Webhooks for global activity (#19863) 2024-06-26 16:48:58 -04:00
geoip.go 🧹 friday cleanup party: substitute deprecated import of go-kit (#19774) 2024-06-17 10:27:31 -03:00
global_schedule.go Remove unneeded interfaces (#1779) 2021-08-24 18:49:56 -03:00
host_certificates.go Fix host certificate parsing with embedded slash (#30827) 2025-07-15 21:24:15 +02:00
host_certificates_test.go Fix host certificate parsing with embedded slash (#30827) 2025-07-15 21:24:15 +02:00
hostresponse.go Add options to populate users and labels on list hosts endpoint (#25621) 2025-01-22 11:17:26 -05:00
hosts.go IdP Authentication before BYOD (#32017) 2025-08-18 18:31:53 +02:00
hosts_test.go BMAA: Add personal enrollment type including aggregate counts (#31091) 2025-07-22 17:24:19 -04:00
installer.go add a new tool to upload installers to blob storage (#6661) 2022-07-14 16:11:52 -03:00
integrations.go Allow configuring webhook policy automations for "No team" (#32129) 2025-08-28 16:38:27 -05:00
invites.go Allow opting in users to email verification on login (#24273) 2024-12-05 08:37:10 -06:00
jobs.go Allow "not_before" timestamp for worker jobs, schedule more quickly (#11512) 2023-05-03 16:25:36 -04:00
labels.go Add support for host vitals labels (#30278) 2025-06-30 09:58:58 -05:00
labels_test.go Improved label(s) validation when running queries (#23834) 2024-11-21 16:13:30 -06:00
linux_mdm.go Add Linux encryption states to APIs (#23806) 2024-11-19 13:11:59 -07:00
live_query_store.go Address multiple redis-related issues observed with live queries (#16855) 2024-02-27 19:35:27 -06:00
logging.go Remove kolide types and packages from backend (#974) 2021-06-06 15:07:29 -07:00
maintained_apps.go software categories: backend (#28479) 2025-05-02 11:41:26 -04:00
mdm.go Add full name IdP Fleet variable to Apple configuration profiles (#32246) 2025-08-26 17:55:58 +02:00
mdm_test.go Wait for expected profiles to be sent before releasing device (#31381) 2025-07-31 17:50:57 +02:00
meta.go Add count to host upcoming activities API response (#16511) 2024-02-06 10:02:38 -06:00
microsoft_mdm.go Added additional logging information for Windows MDM discovery endpoint. (#31691) 2025-08-07 17:05:15 +02:00
microsoft_mdm_test.go fix: process Add commands in Windows MDM profiles (#17570) 2024-03-12 15:21:17 -04:00
network_interfaces.go Remove kolide types and packages from backend (#974) 2021-06-06 15:07:29 -07:00
nudge.go Retime Nudge to 20:00 UTC (#23373) 2024-10-30 09:08:43 -05:00
operating_systems.go Added util func around semver to allow for custom preprocessing. Upgraded semver lib (#25437) 2025-01-23 10:21:15 -06:00
operating_systems_test.go Strip RSR suffixes prior to handing off OS version from Nudge check to Semver comparison (#22830) 2024-10-10 12:15:53 -05:00
orbit.go Ability to set TPM PIN protector policy on host. (#31484) 2025-08-01 13:32:19 -04:00
orbit_test.go Add arm64 support for fleetd extensions and fixes on test scripts (#31084) 2025-07-21 15:47:59 -03:00
osquery.go Fleet server verifies HTTP signature (#30825) 2025-07-16 20:08:27 +02:00
packs.go Add gosimple linter (#23250) 2024-10-29 14:17:51 -05:00
packs_test.go Fix incorrect integer conversion (#10188) 2023-02-28 18:01:25 -08:00
policies.go Microsoft Compliance Partner backend changes (#29540) 2025-06-11 14:22:46 -03:00
policies_test.go Add validation for policy specs (#13294) 2023-08-21 10:22:07 -06:00
queries.go Add labels to queries using gitops (#27259) 2025-03-20 15:32:52 -05:00
queries_test.go 15381 host query report api (#15441) 2023-12-11 15:33:31 -07:00
query_results.go Remove kolide types and packages from backend (#974) 2021-06-06 15:07:29 -07:00
redis_pool.go Use a redis cluster-friendly store for rate limit (#2577) 2021-10-19 16:24:13 -04:00
scheduled_queries.go Add gosimple linter (#23250) 2024-10-29 14:17:51 -05:00
scim.go Add support for IdP department to SCIM and add FLEET_VAR_HOST_END_USER_IDP_DEPARTMENT fleet variable (#30375) 2025-06-29 15:23:03 -03:00
scripts.go Add "batch script host results" API (#32174) 2025-08-27 16:39:43 -05:00
scripts_test.go Allow use of bash as a script interpreter (#25449) 2025-02-04 12:42:40 -05:00
secret_variables.go Add backend APIs for adding, deleting and listing secret variables (#31936) 2025-08-14 19:33:47 -03:00
secret_variables_test.go Add backend APIs for adding, deleting and listing secret variables (#31936) 2025-08-14 19:33:47 -03:00
secrets.go Add secrets software script support (#24912) 2024-12-20 17:17:18 -05:00
service.go Add "batch script host results" API (#32174) 2025-08-27 16:39:43 -05:00
sessions.go Replace home-made SAML implementation with https://github.com/crewjam/saml (#28486) 2025-07-07 15:13:46 -03:00
sessions_test.go Change role of existing users only if SSO attributes are present in the SAMLResponse (#11966) 2023-05-30 17:49:59 -03:00
setup_experience.go Mark setup experience installs as "cancelled" and later fail them when certain bulk actions happen (#29355) 2025-05-27 16:52:51 -04:00
setup_experience_test.go Setup experience state machine (#22845) 2024-10-18 12:01:53 -04:00
software.go 4498 empty software (#31940) 2025-08-19 10:38:53 -04:00
software_installer.go Allow configuring webhook policy automations for "No team" (#32129) 2025-08-28 16:38:27 -05:00
software_installer_test.go Improve memory usage of software installers parsing (#23596) 2024-11-12 09:28:08 -05:00
software_test.go Updated host_software_installs table. 2024-09-06 09:49:27 -05:00
statistics.go Add statistic to measure ABM pending hosts (#28226) 2025-04-15 11:30:07 -04:00
targets.go Update live query selector logic (OR -> AND) (#9559) 2023-01-30 18:35:56 -03:00
targets_test.go Optimize requests on packs page (#3327) 2021-12-13 21:50:24 -08:00
teams.go Allow configuring webhook policy automations for "No team" (#32129) 2025-08-28 16:38:27 -05:00
teams_test.go Bump github.com/go-git/go-git/v5 from 5.11.0 to 5.13.0 (#25280) 2025-01-09 12:09:49 -06:00
traits.go Add support for downloading a list of hosts in CSV format (#4596) 2022-03-15 15:14:42 -04:00
translator.go Remove unneeded interfaces (#1779) 2021-08-24 18:49:56 -03:00
user_roles.go Remove unneeded interfaces (#1779) 2021-08-24 18:49:56 -03:00
users.go Prevent user invite race condition (#29559) 2025-05-29 15:26:02 -04:00
users_test.go Cap salt length before concatenating with plaintext for password updates (#17068) 2024-02-28 11:16:02 -08:00
utils.go Added util func around semver to allow for custom preprocessing. Upgraded semver lib (#25437) 2025-01-23 10:21:15 -06:00
utils_test.go Added util func around semver to allow for custom preprocessing. Upgraded semver lib (#25437) 2025-01-23 10:21:15 -06:00
vpp.go vpp verify followup (#30389) 2025-07-01 11:19:42 -04:00
vulnerabilities.go Pull xz'd goval-dictionary sqlite files to evaluate vulnerabilities on Amazon Linux hosts (#21506) 2024-08-26 14:07:42 -05:00
windows_mdm.go 21979: Extended wipe end-point to allow for doWipe Win CMD (#29770) 2025-06-11 13:56:07 -04:00
windows_mdm_test.go Different errors for configuration_profiles and batch endpoints. (#27411) 2025-03-21 14:24:52 -05:00
windows_updates.go Feature 7076: Ingest installed windows updates (#7138) 2022-08-26 14:55:03 -04:00
windows_updates_tests.go Feature 7076: Ingest installed windows updates (#7138) 2022-08-26 14:55:03 -04:00