fleet/server
Lucas Manuel Rodriguez ab0700b4e0
Fix osquery result logging when queries are configured outside of Fleet (#15393)
#15168

- [X] Changes file added for user-visible changes in `changes/` or
`orbit/changes/`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- [X] Added/updated tests.
- [X] Manual QA for all new/changed functionality.

The issue can be reproduced by running `osqueryd` with
`--config_plugin=filesystem --config_path=/path/to/config.json`
This means the osquery config is fetched from a file rather than from
Fleet's agent settings.
The `/path/to/config.json` has the agent settings, e.g.:
```
{
  "decorators": {
    "load": [
      "SELECT uuid AS host_uuid FROM system_info;",
      "SELECT hostname AS hostname FROM system_info;"
    ]
  },
  "options": {
    "disable_distributed": false,
    "distributed_interval": 10,
    "distributed_plugin": "tls",
    "distributed_tls_max_attempts": 3,
    "logger_tls_endpoint": "/api/osquery/log",
    "logger_tls_period": 10,
    "pack_delimiter": "/"
  },
  "schedule": {
    "USB devices": {
      "query": "SELECT * FROM usb_devices;",
      "interval": 15
    },
    "OS version": {
      "query": "SELECT * FROM os_version;",
      "interval": 10
    }
  },
  "packs": {
    "Elsewhere": {
      "queries": {
        "Osquery Info": {
          "query": "SELECT * FROM osquery_info;",
          "interval": 30,
          "platform": "",
          "version": "",
          "snapshot": true
        }
      }
    }
  }
}
```

The three queries should be logged to Fleet's configured result logging
destination (default is `filesystem`).
2023-12-04 11:18:49 -03:00
..
authz Update authorization for MDM profiles to be platform-independent (#15023) 2023-11-08 11:36:57 -05:00
bindata Allow users to be readded if they were ever removed (#1945) 2021-09-07 13:33:40 -03:00
config Validate that WSTEP is configured before enabling Windows MDM (#14858) 2023-11-09 10:08:54 -03:00
contexts Fix edge case of AppConfig changes getting lost in cached mysql. (#15352) 2023-11-29 10:09:37 -05:00
datastore Add database migrations to support software titles feature (#15401) 2023-12-01 11:33:07 -03:00
errorstore Enable errcheck linter for golangci-lint (#8899) 2022-12-05 16:50:49 -06:00
fleet Add database migrations to support software titles feature (#15401) 2023-12-01 11:33:07 -03:00
health Separate health checks for MySQL and Redis (#6468) 2022-07-01 08:08:03 -03:00
launcher Ingest pending MDM hosts (#9065) 2022-12-26 15:32:39 -06:00
live_query Bump go to 1.19.1 (#7690) 2022-09-12 20:32:43 -03:00
logging chore: remove refs to deprecated io/ioutil (#14485) 2023-10-27 15:28:54 -03:00
mail 14729 smtp settings validation for TLS (#15029) 2023-11-21 11:48:21 -07:00
mdm Add validations to disallow custom MDM profiles that contain names reserved by Fleet (#15373) 2023-11-30 17:19:18 -06:00
mock implement profile verification for windows (#15348) 2023-11-30 09:17:07 -03:00
policies Refactor webhooks cron to new schedule package (#7840) 2022-09-20 14:26:36 -05:00
ptr Add Description text to CVE Metadata (#13856) 2023-09-15 11:24:10 -06:00
pubsub Provide more feedback to the user when there's a Redis connection issue when running live queries (#11947) 2023-06-01 16:11:55 -03:00
service Fix osquery result logging when queries are configured outside of Fleet (#15393) 2023-12-04 11:18:49 -03:00
sso chore: remove refs to deprecated io/ioutil (#14485) 2023-10-27 15:28:54 -03:00
test Prevent empty logging_type when creating and editing queries (#14575) 2023-10-16 19:33:39 -03:00
vulnerabilities HotFix - ambiguous policy search name (#15312) 2023-11-27 12:21:39 -07:00
webhooks chore: remove refs to deprecated io/ioutil (#14485) 2023-10-27 15:28:54 -03:00
websocket Enable errcheck linter for golangci-lint (#8899) 2022-12-05 16:50:49 -06:00
worker chore: remove refs to deprecated io/ioutil (#14485) 2023-10-27 15:28:54 -03:00
utils.go allow to set mdm.windows_settings.custom_settings in configs (#15145) 2023-11-15 13:58:46 -03:00
utils_test.go allow to set mdm.windows_settings.custom_settings in configs (#15145) 2023-11-15 13:58:46 -03:00